| 1 | import type * as ECS from "@distilled.cloud/aws/ecs"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Cluster } from "./Cluster.ts"; |
| 5 | |
| 6 | export interface DescribeServicesRequest extends Omit< |
| 7 | ECS.DescribeServicesRequest, |
| 8 | "cluster" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `ecs:DescribeServices`. |
| 13 | * |
| 14 | * Bind this operation to a `Cluster` inside a function runtime to get a |
| 15 | * callable that describes services in the bound cluster. The cluster ARN is |
| 16 | * injected automatically and the host is granted `ecs:DescribeServices` on |
| 17 | * the cluster's services. |
| 18 | * ### Describing Services |
| 19 | * **Example:** Check a Service's Deployment Status |
| 20 | * ```typescript |
| 21 | * const describeServices = yield* AWS.ECS.DescribeServices(cluster); |
| 22 | * |
| 23 | * const response = yield* describeServices({ services: [serviceName] }); |
| 24 | * const runningCount = response.services?.[0]?.runningCount; |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface DescribeServices extends Binding.Service< |
| 30 | DescribeServices, |
| 31 | "AWS.ECS.DescribeServices", |
| 32 | ( |
| 33 | cluster: Cluster, |
| 34 | ) => Effect.Effect< |
| 35 | ( |
| 36 | request: DescribeServicesRequest, |
| 37 | ) => Effect.Effect<ECS.DescribeServicesResponse, ECS.DescribeServicesError> |
| 38 | > |
| 39 | > {} |
| 40 | export const DescribeServices = Binding.Service<DescribeServices>( |
| 41 | "AWS.ECS.DescribeServices", |
| 42 | ); |