# Copyright 2023 Google LLC. All Rights Reserved.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
info:
  title: ContainerAws/NodePool
  description: An Anthos node pool running on AWS.
  x-dcl-struct-name: NodePool
  x-dcl-has-iam: false
  x-dcl-ref:
    text: API reference
    url: https://cloud.google.com/anthos/clusters/docs/multi-cloud/reference/rest/v1/projects.locations.awsClusters.awsNodePools
  x-dcl-guides:
  - text: Multicloud overview
    url: https://cloud.google.com/anthos/clusters/docs/multi-cloud
paths:
  get:
    description: The function used to get information about a NodePool
    parameters:
    - name: nodePool
      required: true
      description: A full instance of a NodePool
  apply:
    description: The function used to apply information about a NodePool
    parameters:
    - name: nodePool
      required: true
      description: A full instance of a NodePool
  delete:
    description: The function used to delete a NodePool
    parameters:
    - name: nodePool
      required: true
      description: A full instance of a NodePool
  deleteAll:
    description: The function used to delete all NodePool
    parameters:
    - name: project
      required: true
      schema:
        type: string
    - name: location
      required: true
      schema:
        type: string
    - name: cluster
      required: true
      schema:
        type: string
  list:
    description: The function used to list information about many NodePool
    parameters:
    - name: project
      required: true
      schema:
        type: string
    - name: location
      required: true
      schema:
        type: string
    - name: cluster
      required: true
      schema:
        type: string
components:
  schemas:
    NodePool:
      title: NodePool
      x-dcl-id: projects/{{project}}/locations/{{location}}/awsClusters/{{cluster}}/awsNodePools/{{name}}
      x-dcl-parent-container: project
      x-dcl-has-create: true
      x-dcl-has-iam: false
      x-dcl-read-timeout: 0
      x-dcl-apply-timeout: 0
      x-dcl-delete-timeout: 0
      type: object
      required:
      - name
      - version
      - config
      - autoscaling
      - subnetId
      - maxPodsConstraint
      - project
      - location
      - cluster
      properties:
        annotations:
          type: object
          additionalProperties:
            type: string
          x-dcl-go-name: Annotations
          description: 'Optional. Annotations on the node pool. This field has the
            same restrictions as Kubernetes annotations. The total size of all keys
            and values combined is limited to 256k. Key can have 2 segments: prefix
            (optional) and name (required), separated by a slash (/). Prefix must
            be a DNS subdomain. Name must be 63 characters or less, begin and end
            with alphanumerics, with dashes (-), underscores (_), dots (.), and alphanumerics
            between.'
        autoscaling:
          type: object
          x-dcl-go-name: Autoscaling
          x-dcl-go-type: NodePoolAutoscaling
          description: Autoscaler configuration for this node pool.
          required:
          - minNodeCount
          - maxNodeCount
          properties:
            maxNodeCount:
              type: integer
              format: int64
              x-dcl-go-name: MaxNodeCount
              description: Maximum number of nodes in the NodePool. Must be >= min_node_count.
            minNodeCount:
              type: integer
              format: int64
              x-dcl-go-name: MinNodeCount
              description: Minimum number of nodes in the NodePool. Must be >= 1 and
                <= max_node_count.
        cluster:
          type: string
          x-dcl-go-name: Cluster
          description: The awsCluster for the resource
          x-kubernetes-immutable: true
          x-dcl-references:
          - resource: Gkemulticloud/Cluster
            field: name
            parent: true
        config:
          type: object
          x-dcl-go-name: Config
          x-dcl-go-type: NodePoolConfig
          description: The configuration of the node pool.
          required:
          - iamInstanceProfile
          - configEncryption
          properties:
            autoscalingMetricsCollection:
              type: object
              x-dcl-go-name: AutoscalingMetricsCollection
              x-dcl-go-type: NodePoolConfigAutoscalingMetricsCollection
              description: Optional. Configuration related to CloudWatch metrics collection
                on the Auto Scaling group of the node pool. When unspecified, metrics
                collection is disabled.
              required:
              - granularity
              properties:
                granularity:
                  type: string
                  x-dcl-go-name: Granularity
                  description: The frequency at which EC2 Auto Scaling sends aggregated
                    data to AWS CloudWatch. The only valid value is "1Minute".
                metrics:
                  type: array
                  x-dcl-go-name: Metrics
                  description: The metrics to enable. For a list of valid metrics,
                    see https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_EnableMetricsCollection.html.
                    If you specify granularity and don't specify any metrics, all
                    metrics are enabled.
                  x-dcl-send-empty: true
                  x-dcl-list-type: list
                  items:
                    type: string
                    x-dcl-go-type: string
            configEncryption:
              type: object
              x-dcl-go-name: ConfigEncryption
              x-dcl-go-type: NodePoolConfigConfigEncryption
              description: The ARN of the AWS KMS key used to encrypt node pool configuration.
              required:
              - kmsKeyArn
              properties:
                kmsKeyArn:
                  type: string
                  x-dcl-go-name: KmsKeyArn
                  description: The ARN of the AWS KMS key used to encrypt node pool
                    configuration.
            iamInstanceProfile:
              type: string
              x-dcl-go-name: IamInstanceProfile
              description: The name of the AWS IAM role assigned to nodes in the pool.
            instanceType:
              type: string
              x-dcl-go-name: InstanceType
              description: Optional. The AWS instance type. When unspecified, it defaults
                to `m5.large`.
              x-kubernetes-immutable: true
              x-dcl-server-default: true
            labels:
              type: object
              additionalProperties:
                type: string
              x-dcl-go-name: Labels
              description: 'Optional. The initial labels assigned to nodes of this
                node pool. An object containing a list of "key": value pairs. Example:
                { "name": "wrench", "mass": "1.3kg", "count": "3" }.'
              x-kubernetes-immutable: true
            proxyConfig:
              type: object
              x-dcl-go-name: ProxyConfig
              x-dcl-go-type: NodePoolConfigProxyConfig
              description: Proxy configuration for outbound HTTP(S) traffic.
              required:
              - secretArn
              - secretVersion
              properties:
                secretArn:
                  type: string
                  x-dcl-go-name: SecretArn
                  description: The ARN of the AWS Secret Manager secret that contains
                    the HTTP(S) proxy configuration.
                secretVersion:
                  type: string
                  x-dcl-go-name: SecretVersion
                  description: The version string of the AWS Secret Manager secret
                    that contains the HTTP(S) proxy configuration.
            rootVolume:
              type: object
              x-dcl-go-name: RootVolume
              x-dcl-go-type: NodePoolConfigRootVolume
              description: Optional. Template for the root volume provisioned for
                node pool nodes. Volumes will be provisioned in the availability zone
                assigned to the node pool subnet. When unspecified, it defaults to
                32 GiB with the GP2 volume type.
              x-dcl-server-default: true
              properties:
                iops:
                  type: integer
                  format: int64
                  x-dcl-go-name: Iops
                  description: Optional. The number of I/O operations per second (IOPS)
                    to provision for GP3 volume.
                  x-dcl-server-default: true
                kmsKeyArn:
                  type: string
                  x-dcl-go-name: KmsKeyArn
                  description: Optional. The Amazon Resource Name (ARN) of the Customer
                    Managed Key (CMK) used to encrypt AWS EBS volumes. If not specified,
                    the default Amazon managed key associated to the AWS region where
                    this cluster runs will be used.
                sizeGib:
                  type: integer
                  format: int64
                  x-dcl-go-name: SizeGib
                  description: Optional. The size of the volume, in GiBs. When unspecified,
                    a default value is provided. See the specific reference in the
                    parent resource.
                  x-dcl-server-default: true
                throughput:
                  type: integer
                  format: int64
                  x-dcl-go-name: Throughput
                  description: Optional. The throughput to provision for the volume,
                    in MiB/s. Only valid if the volume type is GP3.
                  x-dcl-server-default: true
                volumeType:
                  type: string
                  x-dcl-go-name: VolumeType
                  x-dcl-go-type: NodePoolConfigRootVolumeVolumeTypeEnum
                  description: 'Optional. Type of the EBS volume. When unspecified,
                    it defaults to GP2 volume. Possible values: VOLUME_TYPE_UNSPECIFIED,
                    GP2, GP3'
                  x-dcl-server-default: true
                  enum:
                  - VOLUME_TYPE_UNSPECIFIED
                  - GP2
                  - GP3
            securityGroupIds:
              type: array
              x-dcl-go-name: SecurityGroupIds
              description: Optional. The IDs of additional security groups to add
                to nodes in this pool. The manager will automatically create security
                groups with minimum rules needed for a functioning cluster.
              x-dcl-send-empty: true
              x-dcl-list-type: list
              items:
                type: string
                x-dcl-go-type: string
            sshConfig:
              type: object
              x-dcl-go-name: SshConfig
              x-dcl-go-type: NodePoolConfigSshConfig
              description: Optional. The SSH configuration.
              required:
              - ec2KeyPair
              properties:
                ec2KeyPair:
                  type: string
                  x-dcl-go-name: Ec2KeyPair
                  description: The name of the EC2 key pair used to login into cluster
                    machines.
            tags:
              type: object
              additionalProperties:
                type: string
              x-dcl-go-name: Tags
              description: Optional. Key/value metadata to assign to each underlying
                AWS resource. Specify at most 50 pairs containing alphanumerics, spaces,
                and symbols (.+-=_:@/). Keys can be up to 127 Unicode characters.
                Values can be up to 255 Unicode characters.
            taints:
              type: array
              x-dcl-go-name: Taints
              description: Optional. The initial taints assigned to nodes of this
                node pool.
              x-kubernetes-immutable: true
              x-dcl-send-empty: true
              x-dcl-list-type: list
              items:
                type: object
                x-dcl-go-type: NodePoolConfigTaints
                required:
                - key
                - value
                - effect
                properties:
                  effect:
                    type: string
                    x-dcl-go-name: Effect
                    x-dcl-go-type: NodePoolConfigTaintsEffectEnum
                    description: 'The taint effect. Possible values: EFFECT_UNSPECIFIED,
                      NO_SCHEDULE, PREFER_NO_SCHEDULE, NO_EXECUTE'
                    x-kubernetes-immutable: true
                    enum:
                    - EFFECT_UNSPECIFIED
                    - NO_SCHEDULE
                    - PREFER_NO_SCHEDULE
                    - NO_EXECUTE
                  key:
                    type: string
                    x-dcl-go-name: Key
                    description: Key for the taint.
                    x-kubernetes-immutable: true
                  value:
                    type: string
                    x-dcl-go-name: Value
                    description: Value for the taint.
                    x-kubernetes-immutable: true
        createTime:
          type: string
          format: date-time
          x-dcl-go-name: CreateTime
          readOnly: true
          description: Output only. The time at which this node pool was created.
          x-kubernetes-immutable: true
        etag:
          type: string
          x-dcl-go-name: Etag
          readOnly: true
          description: Allows clients to perform consistent read-modify-writes through
            optimistic concurrency control. May be sent on update and delete requests
            to ensure the client has an up-to-date value before proceeding.
          x-kubernetes-immutable: true
        location:
          type: string
          x-dcl-go-name: Location
          description: The location for the resource
          x-kubernetes-immutable: true
        maxPodsConstraint:
          type: object
          x-dcl-go-name: MaxPodsConstraint
          x-dcl-go-type: NodePoolMaxPodsConstraint
          description: The constraint on the maximum number of pods that can be run
            simultaneously on a node in the node pool.
          x-kubernetes-immutable: true
          required:
          - maxPodsPerNode
          properties:
            maxPodsPerNode:
              type: integer
              format: int64
              x-dcl-go-name: MaxPodsPerNode
              description: The maximum number of pods to schedule on a single node.
              x-kubernetes-immutable: true
        name:
          type: string
          x-dcl-go-name: Name
          description: The name of this resource.
          x-kubernetes-immutable: true
        project:
          type: string
          x-dcl-go-name: Project
          description: The project for the resource
          x-kubernetes-immutable: true
          x-dcl-references:
          - resource: Cloudresourcemanager/Project
            field: name
            parent: true
        reconciling:
          type: boolean
          x-dcl-go-name: Reconciling
          readOnly: true
          description: Output only. If set, there are currently changes in flight
            to the node pool.
          x-kubernetes-immutable: true
        state:
          type: string
          x-dcl-go-name: State
          x-dcl-go-type: NodePoolStateEnum
          readOnly: true
          description: 'Output only. The lifecycle state of the node pool. Possible
            values: STATE_UNSPECIFIED, PROVISIONING, RUNNING, RECONCILING, STOPPING,
            ERROR, DEGRADED'
          x-kubernetes-immutable: true
          enum:
          - STATE_UNSPECIFIED
          - PROVISIONING
          - RUNNING
          - RECONCILING
          - STOPPING
          - ERROR
          - DEGRADED
        subnetId:
          type: string
          x-dcl-go-name: SubnetId
          description: The subnet where the node pool node run.
          x-kubernetes-immutable: true
        uid:
          type: string
          x-dcl-go-name: Uid
          readOnly: true
          description: Output only. A globally unique identifier for the node pool.
          x-kubernetes-immutable: true
        updateTime:
          type: string
          format: date-time
          x-dcl-go-name: UpdateTime
          readOnly: true
          description: Output only. The time at which this node pool was last updated.
          x-kubernetes-immutable: true
        version:
          type: string
          x-dcl-go-name: Version
          description: The Kubernetes version to run on this node pool (e.g. `1.19.10-gke.1000`).
            You can list all supported versions on a given Google Cloud region by
            calling GetAwsServerConfig.
