List Buckets
Retrieve all Cloud Storage buckets across all GCP projects.
Response
Array of projects with their buckets
Array of buckets in this project
Bucket name (globally unique)
Bucket location (e.g., “US”, “EUROPE-WEST1”)
Storage class (e.g., “STANDARD”, “NEARLINE”)
ISO 8601 timestamp of bucket creation
Example Request
curl -X GET https://api.example.com/api/projects/list_buckets \
-H "Cookie: session=your-session-token"
Example Response
{
"value": [
{
"projectId": "my-project-123",
"displayName": "My Project",
"buckets": [
{
"name": "my-bucket-name",
"location": "US",
"storageClass": "STANDARD",
"timeCreated": "2024-01-15T10:30:00Z"
}
]
}
]
}
Create Bucket
Create a new Cloud Storage bucket in a specific project.
Request Body
GCP project ID where the bucket will be created
Globally unique name for the bucket
Bucket location (e.g., “US”, “EUROPE-WEST1”)
Storage class: “STANDARD”, “NEARLINE”, “COLDLINE”, or “ARCHIVE”
Example Request
curl -X POST https://api.example.com/api/projects/create_bucket \
-H "Content-Type: application/json" \
-H "Cookie: session=your-session-token" \
-d '{
"projectId": "my-project-123",
"bucketName": "my-unique-bucket-name",
"location": "US",
"storageClass": "STANDARD"
}'
Response
Success message with bucket details
{
"message": "Bucket 'my-unique-bucket-name' został pomyślnie utworzony w lokalizacji 'US'."
}
Configuration Details
- Uniform bucket-level access is enabled by default
- Bucket names must be globally unique across all GCP
- Names must be 3-63 characters, lowercase letters, numbers, hyphens, and underscores
Delete Bucket
Delete a Cloud Storage bucket.
Request Body
GCP project ID containing the bucket
Name of the bucket to delete
If true, deletes all objects in the bucket before deletion
Example Request
curl -X DELETE https://api.example.com/api/projects/delete_bucket \
-H "Content-Type: application/json" \
-H "Cookie: session=your-session-token" \
-d '{
"projectId": "my-project-123",
"bucketName": "my-bucket-name",
"force": true
}'
Response
{
"message": "Bucket 'my-bucket-name' został pomyślnie usunięty."
}
List Blobs in Bucket
List all objects (blobs) in a specific bucket.
Query Parameters
GCP project ID containing the bucket
Example Request
curl -X GET "https://api.example.com/api/gcp/buckets/blobs?bucketName=my-bucket&projectId=my-project-123" \
-H "Cookie: session=your-session-token"
Response
Array of blobs in the bucket
Object name (path in bucket)
ISO 8601 timestamp of last update
{
"value": [
{
"name": "folder/file.txt",
"size": 1024,
"updated": "2024-02-20T14:30:00Z"
}
]
}
Upload Blob
Upload a file to a Cloud Storage bucket.
Request Body (multipart/form-data)
Name of the destination bucket
GCP project ID containing the bucket
Example Request
curl -X POST https://api.example.com/api/gcp/buckets/blobs \
-H "Cookie: session=your-session-token" \
-F "file=@/path/to/local/file.txt" \
-F "bucketName=my-bucket" \
-F "projectId=my-project-123"
Response
{
"message": "Plik 'file.txt' został pomyślnie wysłany."
}
Download Blob
Download a file from a Cloud Storage bucket.
Query Parameters
GCP project ID containing the bucket
Name of the blob to download
Example Request
curl -X GET "https://api.example.com/api/gcp/buckets/blobs/download?bucketName=my-bucket&projectId=my-project-123&blobName=file.txt" \
-H "Cookie: session=your-session-token" \
-o downloaded-file.txt
Response
Returns the file content with appropriate Content-Type header.
Delete Blob
Delete an object from a Cloud Storage bucket.
Request Body
GCP project ID containing the bucket
Name of the blob to delete
Example Request
curl -X DELETE https://api.example.com/api/gcp/buckets/blobs \
-H "Content-Type: application/json" \
-H "Cookie: session=your-session-token" \
-d '{
"bucketName": "my-bucket",
"projectId": "my-project-123",
"blobName": "file.txt"
}'
Response
{
"message": "Plik 'file.txt' został pomyślnie usunięty."
}