Skip to main content

List Container Services

Retrieve all Cloud Run services across all GCP projects and regions.

Response

value
array
Array of Cloud Run services

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

projectId
string
required
GCP project ID where the service will be created
region
string
required
Region where the service will be deployed (e.g., “europe-west1”, “europe-central2”)
serviceName
string
required
Name for the new Cloud Run service
imageUri
string
required
Container image URI (e.g., “gcr.io/my-project/my-image:latest”)
containerPort
string
default:"8080"
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

message
string
Success message confirming service creation
url
string
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

projectId
string
required
GCP project ID containing the service
region
string
required
Region where the service is deployed
serviceName
string
required
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

message
string
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'."
}

Build docs developers (and LLMs) love