List Container Services
Retrieve all Cloud Run services across all GCP projects and regions.
Response
Array of Cloud Run services
Cloud provider identifier (always “GCP”)
Region where the service is deployed (e.g., “europe-west1”)
Public URL of the Cloud Run service
ISO 8601 timestamp of service creation
ISO 8601 timestamp of last update
Project ID containing this service
Example Request
curl -X GET https://api.example.com/api/gcp/list_containers \
-H "Cookie: session=your-session-token"
Example Response
{
"value": [
{
"provider": "GCP",
"name": "my-service",
"id": "projects/my-project-123/locations/europe-west1/services/my-service",
"region": "europe-west1",
"url": "https://my-service-abc123-ew.a.run.app",
"created": "2024-01-15T10:30:00Z",
"updated": "2024-02-20T14:45:00Z",
"projectId": "my-project-123"
}
]
}
Create Container Service
Create a new Cloud Run service in a specific project and region.
Request Body
GCP project ID where the service will be created
Region where the service will be deployed (e.g., “europe-west1”, “europe-central2”)
Name for the new Cloud Run service
Container image URI (e.g., “gcr.io/my-project/my-image:latest”)
Port that the container listens on
Example Request
curl -X POST https://api.example.com/api/gcp/create_container \
-H "Content-Type: application/json" \
-H "Cookie: session=your-session-token" \
-d '{
"projectId": "my-project-123",
"region": "europe-west1",
"serviceName": "my-service",
"imageUri": "us-docker.pkg.dev/cloudrun/container/hello",
"containerPort": "8080"
}'
Response
Success message confirming service creation
Public URL of the created service
{
"message": "Usługa Cloud Run 'my-service' została pomyślnie utworzona.",
"url": "https://my-service-abc123-ew.a.run.app"
}
Configuration Details
The created service includes:
- Automatic scaling configuration (0-1 instances)
- Public ingress enabled (INGRESS_TRAFFIC_ALL)
- Default timeout and memory limits
Delete Container Service
Delete a Cloud Run service from a specific project and region.
Request Body
GCP project ID containing the service
Region where the service is deployed
Name of the Cloud Run service to delete
Example Request
curl -X DELETE https://api.example.com/api/gcp/delete_container \
-H "Content-Type: application/json" \
-H "Cookie: session=your-session-token" \
-d '{
"projectId": "my-project-123",
"region": "europe-west1",
"serviceName": "my-service"
}'
Response
Success message confirming service deletion
{
"message": "Rozpoczęto usuwanie usługi Cloud Run 'my-service'."
}
Error Responses
{
"error": "Usługa Cloud Run o nazwie 'my-service' już istnieje w regionie 'europe-west1'."
}
{
"error": "Brak uprawnień do tworzenia usługi Cloud Run w projekcie 'my-project-123'."
}