ReferenceFlightcontrol APIServicesGet Scaling Info

Get Service Scaling Information

API Description

  • Method: GET
  • Path: /v1/services/:serviceId/scaling
  • Full Endpoint: https://api.flightcontrol.com/v1/services/:serviceId/scaling

Headers

  • Authorization: Bearer token (required)
  • Content-Type: application/json

Parameters

Path Parameters

  • serviceId (string, required) - The unique identifier of the service

Request Example

curl -X GET https://api.flightcontrol.com/v1/services/cmds18v130000485zbcat00xy/scaling \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

Success Response (200 OK)

{
  "serviceId": "cmds18v130000485zbcat00xy",
  "currentInstances": 3,
  "desiredInstances": 3,
  "runningInstances": 3,
  "pendingInstances": 0,
  "autoscalingEnabled": true,
  "minInstances": 1,
  "maxInstances": 10
}

Error Response (404 Not Found)

{
  "message": "Service not found",
  "errorCode": "FC:Request:Error:NOT_FOUND"
}

Error Response (401 Unauthorized)

{
  "message": "Please use an API key for this request",
  "errorCode": "FC:Request:Error:UNAUTHORIZED"
}

Response Fields

  • serviceId - The unique identifier of the service
  • currentInstances - Current number of instances (running + pending)
  • desiredInstances - Target number of instances set by ECS
  • runningInstances - Number of instances in RUNNING state
  • pendingInstances - Number of instances in PENDING state
  • autoscalingEnabled - Whether autoscaling is enabled for this service
  • minInstances - Minimum number of instances (from autoscaling configuration)
  • maxInstances - Maximum number of instances (from autoscaling configuration)

Error Response (403 Forbidden)

{
  "message": "User doesn't have permission to access this service",
  "errorCode": "FC:Request:Error:FORBIDDEN"
}

Response Conditions

  • 200 OK - Service scaling information retrieved successfully
  • 401 Unauthorized - Invalid or missing API key
  • 403 Forbidden - User doesn’t have permission to access this service
  • 404 Not Found - Service not found or not a scalable service type

Supported Service Types

This endpoint is available for the following service types:

  • Web services (web)
  • Private web services (web-private)
  • Worker services (worker)
  • Network servers (network-server)
  • Private network servers (private-network-server)

Note: Scheduler services do not support this endpoint as they have different scaling characteristics.