diff --git a/components/schemas/containers/config/ContainerDeploy.yml b/components/schemas/containers/config/ContainerDeploy.yml index 97764ad7..b156f392 100644 --- a/components/schemas/containers/config/ContainerDeploy.yml +++ b/components/schemas/containers/config/ContainerDeploy.yml @@ -8,7 +8,9 @@ properties: type: integer description: The number of initial desired instances for a given container. strategy: - $ref: ../../infrastructure/DeploymentStrategyName.yml + oneOf: + - $ref: ../../infrastructure/DeploymentStrategyName.yml + - type: "null" description: The deployment strategy to use when scaling the given container. function: description: Configuration options for containers using the 'function' deployment strategy. @@ -37,141 +39,185 @@ properties: description: The maximum amount of time Cycle will wait for an instance to be available. - type: "null" stateful: - type: object - properties: - options: - oneOf: - - type: "object" - properties: - use_base_hostname: - type: - - boolean - - "null" - - type: "null" + description: Configuration options for stateful deployments. + oneOf: + - type: object + properties: + options: + description: Options that modify behavior for stateful deployments. + oneOf: + - type: "object" + properties: + use_base_hostname: + description: When set, the base hostname will be used instead of a generated hostname. + type: + - boolean + - "null" + - type: "null" + - type: "null" + constraints: - type: object description: Settings that give more granular control over deployment targets and conditions. - properties: - node: - type: object - description: Constraint settings related to which nodes an instance can be deployed to. - required: - - tags + oneOf: + - type: object properties: - tags: - type: object - description: Lists of server tags that formally declair servers that match the criteria for deployment. - properties: - any: - type: array - items: - type: string - description: A list of tags where a server matching any tags from the list is qualified as a deployment target. - all: - type: array - items: - type: string - description: A list of tags where a server matching all tags from the list is the only scenario where the server is qualified as a deployment target. - secrets: - type: array - items: - type: string + node: + oneOf: + - type: object + description: Constraint settings related to which nodes an instance can be deployed to. + required: + - tags + properties: + tags: + type: object + description: Lists of server tags that formally declair servers that match the criteria for deployment. + properties: + any: + type: + - array + - "null" + items: + type: string + description: A list of tags where a server matching any tags from the list is qualified as a deployment target. + all: + type: + - array + - "null" + items: + type: string + description: A list of tags where a server matching all tags from the list is the only scenario where the server is qualified as a deployment target. + - type: "null" + secrets: + description: A list of secret identifiers that will be made available to the container. + type: + - array + - "null" + items: + type: string + - type: "null" + shutdown: - type: object description: Configuration for what to do during container shutdown. - properties: - graceful_timeout: - anyOf: - - $ref: ../../Duration.yml - - type: "null" - description: How long the platform will wait for a container to stop gracefully. - signals: - type: - - array - - "null" - items: - $ref: ShutdownSignal.yml - description: Process signal sent to the container process. + oneOf: + - type: object + properties: + graceful_timeout: + anyOf: + - $ref: ../../Duration.yml + - type: "null" + description: How long the platform will wait for a container to stop gracefully. + signals: + type: + - array + - "null" + items: + $ref: ShutdownSignal.yml + description: Process signal sent to the container process. + - type: "null" + startup: - type: object description: Configurations for container startup. - properties: - delay: - $ref: ../../Duration.yml - description: How long the platform will wait before sending the start signal to the given container. + oneOf: + - type: object + properties: + delay: + $ref: ../../Duration.yml + description: How long the platform will wait before sending the start signal to the given container. + - type: "null" update: - type: object description: Configurations for container updates. - properties: - stagger: - $ref: ../../Duration.yml - description: When set, Cycle will pick a random time from `0 - this duration`, and stagger the instances so they all start at different times (up to the time specified here). + oneOf: + - type: object + properties: + stagger: + $ref: ../../Duration.yml + description: When set, Cycle will pick a random time from `0 - this duration`, and stagger the instances so they all start at different times (up to the time specified here). + - type: "null" + restart: - type: object description: Configurations for container restart events. - required: - - condition - - delay - - max_attempts - properties: - condition: - type: string - description: Policy for what should happen in the event of a container dying. - enum: - - always - - never - - failure - delay: - $ref: ../../Duration.yml - description: How long the platform will wait before trying to restart the container. - max_attempts: - type: integer - description: The amount of times the platform will attempt the restart policies. + oneOf: + - type: object + required: + - condition + - delay + - max_attempts + properties: + condition: + type: string + description: Policy for what should happen in the event of a container dying. + enum: + - always + - never + - failure + delay: + $ref: ../../Duration.yml + description: How long the platform will wait before trying to restart the container. + max_attempts: + type: integer + description: The amount of times the platform will attempt the restart policies. + - type: "null" + readiness_check: + description: Configuration for determining readiness of a container. + oneOf: + - type: object + required: [command, interval, timeout] + properties: + command: + type: string + description: The command that will be run to verify readiness of the container. + interval: + $ref: ../../Duration.yml + timeout: + $ref: ../../Duration.yml + - type: "null" health_check: - type: object description: Configuration for determining the health of a container. - required: - - command - - retries - - delay - - interval - - timeout - - restart - properties: - command: - type: string - description: The command that will be run to verify the health of the container. - retries: - type: integer - description: The number of times the platform will retry the command before marking the container unhealthy. - delay: - anyOf: - - $ref: ../../Duration.yml - - type: "null" - description: How long to wait before performing an initial health check when the instance starts. The `state.health.healthy` field of the instance will be `null`` until the first check is performed. - interval: - $ref: ../../Duration.yml - description: How long to wait between restarts. - timeout: - $ref: ../../Duration.yml - description: How long before a health check attempt times out. - restart: - type: boolean - description: A boolean where `true` represents the desire for a container to restart if unhealthy. + oneOf: + - type: object + required: + - command + - retries + - delay + - interval + - timeout + - restart + properties: + command: + type: string + description: The command that will be run to verify the health of the container. + retries: + type: integer + description: The number of times the platform will retry the command before marking the container unhealthy. + delay: + $ref: ../../Duration.yml + description: How long to wait before performing an initial health check when the instance starts. The `state.health.healthy` field of the instance will be `null`` until the first check is performed. + interval: + $ref: ../../Duration.yml + description: How long to wait between restarts. + timeout: + $ref: ../../Duration.yml + description: How long before a health check attempt times out. + restart: + type: boolean + description: A boolean where `true` represents the desire for a container to restart if unhealthy. + - type: "null" telemetry: - type: object description: Configuration settings for container telemetery reporting. - required: - - retention - - interval - - disable - properties: - retention: - $ref: ../../Duration.yml - description: How long telemetry data should be retained. - interval: - $ref: ../../Duration.yml - description: The duration between samples. - disable: - type: boolean - description: A boolean where true disables all telemetry reporting for this container. + oneOf: + - type: object + required: + - retention + - interval + - disable + properties: + retention: + $ref: ../../Duration.yml + description: How long telemetry data should be retained. + interval: + $ref: ../../Duration.yml + description: The duration between samples. + disable: + type: boolean + description: A boolean where true disables all telemetry reporting for this container. + - type: "null" diff --git a/components/schemas/containers/instances/InstanceState.yml b/components/schemas/containers/instances/InstanceState.yml index 0bb94993..da6a9c34 100644 --- a/components/schemas/containers/instances/InstanceState.yml +++ b/components/schemas/containers/instances/InstanceState.yml @@ -18,24 +18,45 @@ allOf: - deleting - deleted health: - type: - - object - - "null" description: information about the health of the instance. - required: - - healthy - - updated - properties: - healthy: - type: - - boolean - - "null" - description: | - Describes the healthiness of the instance. Health checks can be configured at the container level. - - `true`: The instance is considered healthy. - - `false`: The instance is considered unhealthy. - - `null`: The instance has not yet reported its health, or a health check has not yet been performed. - updated: - description: A timestamp of the last time the instance health was updated. - $ref: "../../DateTime.yml" + oneOf: + - type: object + required: + - healthy + - updated + properties: + healthy: + description: | + Describes the healthiness of the instance. Health checks can be configured at the container level. + - `true`: The instance is considered healthy. + - `false`: The instance is considered unhealthy. + - `null`: The instance has not yet reported its health, or a health check has not yet been performed. + oneOf: + - type: boolean + - type: "null" + updated: + description: A timestamp of the last time the instance health was updated. + $ref: "../../DateTime.yml" + - type: "null" + readiness: + description: information about the readiness of the instance. + oneOf: + - type: object + required: + - ready + - updated + properties: + ready: + description: | + Describes the readiness of the instance. + - `true`: The instance is ready. + - `false`: The instance is not ready. + - `null`: The instance has not yet reported its readiness, or a readiness check has not yet been performed. + oneOf: + - type: boolean + - type: "null" + updated: + description: A timestamp of the last time the instance readiness was updated. + $ref: "../../DateTime.yml" + - type: "null" - $ref: "../../State.yml" diff --git a/platform/api.yml b/platform/api.yml index 45b7207c..ea0c5e2e 100644 --- a/platform/api.yml +++ b/platform/api.yml @@ -430,6 +430,8 @@ paths: ## TLS "/v1/dns/tls/attempts": $ref: "./paths/dns/tls/attempts.yml" + "/v1/dns/tls/certificates": + $ref: "./paths/dns/tls/certificates.yml" "/v1/dns/tls/certificates/lookup": $ref: "./paths/dns/tls/lookup.yml" "/v1/dns/tls/certificates/user-supplied": diff --git a/platform/paths/dns/tls/certificates.yml b/platform/paths/dns/tls/certificates.yml new file mode 100644 index 00000000..4a9622f0 --- /dev/null +++ b/platform/paths/dns/tls/certificates.yml @@ -0,0 +1,47 @@ +get: + operationId: "getAllTlsCertificates" + summary: List all TLS Certificates whether user generated or automatically generated by the platform. + description: | + Retrieve a list of TLS certificates. + + Requires the `dns-certs-view` capability. + tags: + - TLS + parameters: + - name: filter + in: query + # Deep nested arrays are undefined https://github.com/OAI/OpenAPI-Specification/issues/1706 + style: deepObject + required: false + description: | + ## Filter Field + The filter field is a key-value object, where the key is what you would like to filter, and the value is the value you're filtering for. + schema: + type: object + properties: + domain: + type: string + description: | + `filter[domain]=value1` filter user certificates by associated domain. + state: + type: string + description: | + `filter[state]=value1,value2` state filtering will allow filtering by the current state. + - $ref: ../../../../components/parameters/SortParam.yml + - $ref: ../../../../components/parameters/PageParam.yml + responses: + 200: + description: Returns a TLS certificate. + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: ../../../../components/schemas/dns/tls/TlsCertificate.yml + default: + $ref: ../../../../components/responses/errors/DefaultError.yml diff --git a/platform/paths/infrastructure/external-volumes/external-volumes.yml b/platform/paths/infrastructure/external-volumes/external-volumes.yml index 67e224e9..909b9ef3 100644 --- a/platform/paths/infrastructure/external-volumes/external-volumes.yml +++ b/platform/paths/infrastructure/external-volumes/external-volumes.yml @@ -60,6 +60,10 @@ get: type: string description: | `filter[state]=value1,value2` state filtering will allow you to filter by the attached volume's current state. + unused: + type: string + description: | + `filter[unused]=true` List only those external volumes that are unused (not attached). - $ref: ../../../../components/parameters/SortParam.yml - $ref: ../../../../components/parameters/PageParam.yml responses: diff --git a/stackspec/schema/StackSpecContainerConfigDeploy.yml b/stackspec/schema/StackSpecContainerConfigDeploy.yml index 6d62ccc8..52326a1f 100644 --- a/stackspec/schema/StackSpecContainerConfigDeploy.yml +++ b/stackspec/schema/StackSpecContainerConfigDeploy.yml @@ -22,9 +22,7 @@ properties: - ** function **: Every ingress request/connection receives its own instance. - ** manual **: Cycle will not make any decisions on where instances are deployed. Instead, instances must be deployed manually using the portal or API. oneOf: - - type: - - string - - "null" + - type: string enum: - resource-density - manual @@ -34,96 +32,100 @@ properties: - edge - function default: first-available + - type: "null" - $ref: StackVariable.yml + function: description: Configuration options for containers using the 'function' deployment strategy. oneOf: - - type: - - object - - "null" + - type: object properties: max_pool_size: description: The maximum number of instances that Cycle can pre-allocate (includes auto-scaled instances). oneOf: - - type: - - integer - - "null" + - type: integer + - type: "null" - $ref: StackVariable.yml max_shard_concurrency: description: For each shard (scheduler), the maximum number of tasks it can run in parallel. oneOf: - - type: - - integer - - "null" + - type: integer + - type: "null" - $ref: StackVariable.yml max_runtime: description: The maximum amount of time a function instance can run before timing out. anyOf: - $ref: ../../components/schemas/Duration.yml - - $ref: StackVariable.yml - type: "null" + - $ref: StackVariable.yml max_queue_time: description: The maximum amount of time Cycle will wait for an instance to be available. anyOf: - $ref: ../../components/schemas/Duration.yml - - $ref: StackVariable.yml - type: "null" + - $ref: StackVariable.yml + - type: "null" - $ref: StackVariable.yml + stateful: description: Configuration options for stateful containers. oneOf: - - type: - - object - - "null" + - type: object required: - options properties: options: description: Stateful container options. - type: - - object - - "null" - properties: - use_base_hostname: - description: When enabled, instances will utilize stateless base hostnames instead of being prefixed with a unique ID. - type: - - boolean - - "null" + oneOf: + - type: object + properties: + use_base_hostname: + description: When enabled, instances will utilize stateless base hostnames instead of being prefixed with a unique ID. + type: + - boolean + - "null" + - type: "null" + - $ref: StackVariable.yml + - type: "null" - $ref: StackVariable.yml + constraints: description: Configuration options that provide the ability to set restrictions on which nodes instances of this container are able to be deployed to. (i.e. if you have a GPU container, it should only go on nodes with a GPU). oneOf: - - type: - - object - - "null" + - type: object properties: node: - type: - - object - - "null" - required: - - tags - properties: - tags: - description: Tags applied to a node. Cycle generates some automatically, but additional, custom tags can be applied on a per-node basis. - oneOf: - - type: object - properties: - any: - description: If a node has at least one of these tags, it is considered a valid deployment target for this container. - oneOf: - - type: array - items: - type: string - - $ref: StackVariable.yml - all: - description: A node must have **ALL** of these tags to be considered a valid deployment target for this container. - oneOf: - - type: array - items: - type: string - - $ref: StackVariable.yml - - $ref: StackVariable.yml + description: Constraint settings related to which nodes an instance can be deployed to. + oneOf: + - type: object + required: + - tags + properties: + tags: + description: Tags applied to a node. Cycle generates some automatically, but additional, custom tags can be applied on a per-node basis. + oneOf: + - type: object + properties: + any: + description: If a node has at least one of these tags, it is considered a valid deployment target for this container. + oneOf: + - type: array + items: + type: string + - type: "null" + - $ref: StackVariable.yml + all: + description: A node must have **ALL** of these tags to be considered a valid deployment target for this container. + oneOf: + - type: array + items: + type: string + - type: "null" + - $ref: StackVariable.yml + - type: "null" + - $ref: StackVariable.yml + - type: "null" + - $ref: StackVariable.yml # Not yet implemented. # secrets: # type: @@ -137,13 +139,13 @@ properties: # - "null" # items: # type: string + - type: "null" - $ref: StackVariable.yml + shutdown: description: Configuration options for how this container behaves during shutdown. oneOf: - - type: - - object - - "null" + - type: object properties: graceful_timeout: description: How long the platform will wait for a container to stop gracefully. @@ -152,19 +154,20 @@ properties: - $ref: StackVariable.yml - type: "null" signals: + description: Signals that should be sent to the container on shutdown. oneOf: - type: array - description: Signals that should be sent to the container on shutdown. items: $ref: ../../components/schemas/containers/config/ShutdownSignal.yml + - type: "null" - $ref: StackVariable.yml + - type: "null" - $ref: StackVariable.yml + startup: description: Configuration options for how this container behaves during startup. oneOf: - - type: - - object - - "null" + - type: object properties: delay: description: How long the platform will wait before sending the start signal to the given container. @@ -172,13 +175,13 @@ properties: - $ref: ../../components/schemas/Duration.yml - $ref: StackVariable.yml - type: "null" + - type: "null" - $ref: StackVariable.yml + update: description: Configurations for how the container behaves during updates. oneOf: - - type: - - object - - "null" + - type: object properties: stagger: anyOf: @@ -186,13 +189,13 @@ properties: - $ref: StackVariable.yml - type: "null" description: When set, Cycle will pick a random time from `0 - this duration`, and stagger the instances so they all start at different times (up to the time specified here). + - type: "null" - $ref: StackVariable.yml + restart: description: Configuration options for how Cycle should handle restarting this container (i.e. in case the process inside the container dies). oneOf: - - type: - - object - - "null" + - type: object required: - condition - delay @@ -217,13 +220,29 @@ properties: oneOf: - type: integer - $ref: StackVariable.yml + - type: "null" + - $ref: StackVariable.yml + + readiness_check: + description: Configuration for determining readiness of a container. + oneOf: + - type: object + required: [command, interval, timeout] + properties: + command: + type: string + description: The command that will be run to verify readiness of the container. + interval: + $ref: ../../components/schemas/Duration.yml + timeout: + $ref: ../../components/schemas/Duration.yml + - type: "null" - $ref: StackVariable.yml + health_check: description: Configuration options for automated container health checks. oneOf: - - type: - - object - - "null" + - type: object required: - command - retries @@ -270,38 +289,38 @@ properties: - $ref: StackVariable.yml - type: "null" description: How long to wait after a container start event before running health checks. + - type: "null" - $ref: StackVariable.yml + telemetry: description: Configuration options for how the instance telemetry (CPU usage, etc) is handled. oneOf: - - type: - - object - - "null" + - type: object required: - disable properties: retention: anyOf: - $ref: ../../components/schemas/Duration.yml - - $ref: StackVariable.yml - type: "null" + - $ref: StackVariable.yml description: How long telemetry data should be retained. interval: anyOf: - $ref: ../../components/schemas/Duration.yml - - $ref: StackVariable.yml - type: "null" + - $ref: StackVariable.yml description: The duration between samples. webhook: description: A URL where Cycle will send telemetry data to. The payload will be an instance resource snapshot. oneOf: - - type: - - string - - "null" + - type: string + - type: "null" - $ref: StackVariable.yml disable: description: If true, Cycle will not aggregate telemetry for this container's instances. oneOf: - type: boolean - $ref: StackVariable.yml + - type: "null" - $ref: StackVariable.yml