openapi: 3.0.0
info:
  title: Apple silicon - Private Networks API
  description: "Private Networks facilitate the interconnection of resources via a
    dedicated, private, and flexible L2 network.\n\nThis documentation describes the
    usage of the Private Network feature on Apple silicon servers.\n\nYou can multiple
    resources to your Private Networks, and can connect up to eight (8) distinct Private
    Networks per server, in the form of additional network interfaces within the server
    (VLANs). \nWith this feature, you can isolate services from the public internet
    and expose them to the rest of your infrastructure without concern about public
    network filtering.\n\nServers can be added or removed from a Private Network at
    any time, even while running. The network interface will be hot-plugged into the
    server, and software can be configured to set it up automatically as soon as it
    appears.\n\n(switchcolumn)\n<Message type=\"important\">\nThis documentation refers
    to Private Networks for Apple silicon servers. If you are looking for information
    for Private Networks on other products, refer to our [VPC API documentation](/api/vpc/).\n</Message>\n(switchcolumn)\n##
    Concepts\n\nRefer to our [dedicated concepts page](https://www.scaleway.com/en/docs/bare-metal/apple-silicon/concepts/)
    to find definitions of all concepts and terminology related to Apple silicon servers.\n\n##
    Quickstart\n\n(switchcolumn)\n(switchcolumn)\n\n1. Configure your environment
    variables.\n    ```bash\n    export SCW_SECRET_KEY=\"<API secret key>\"\n    export
    SCW_DEFAULT_ZONE=\"<Scaleway Availability Zone>\"\n    export SCW_PROJECT_ID=\"<Scaleway
    Project ID>\"\n    ```\n    <Message type=\"tip\">\n    This is an optional step
    that seeks to simplify your usage of the Private Netowrks API. See [Availability
    Zones](#availability-zones) below for help choosing an Availability Zone. You
    can find your Project ID in the [Scaleway console](https://console.scaleway.com/project/settings).\n
    \   </Message>\n\n2. Create a [Private Network for your Apple silicon server](https://www.scaleway.com/en/developers/api/vpc/).\n\n3.
    Add a server to the Private Network.\n    ```bash\n    curl -s -H \"Content-Type:
    application/json\" \\\n        -H \"X-Auth-Token: $SECRET_KEY\" \\\n        https://api.scaleway.com/apple-silicon/v1alpha1/zones/$SCW_DEFAULT_ZONE/servers/$EM_SERVER_ID/private-networks
    \\\n        -d '{\"private_network_id\": \"'$PN_ID'\"}'\n    ```\n    <Message
    type=\"note\">\n    Keep the `vlan` field from the response. It is your VLAN ID,
    and will be used\n    to configure the server to handle traffic from and to the
    Private Network.\n    </Message>\n\n4. Connect to your Apple silicon server and
    use the following command to configure your Private Network interface\"\n    ```bash\n
    \   sudo ip link add link eno1 name eno1.$VLAN type vlan id $VLAN\n    sudo ip
    link set eno1.$VLAN up\n    sudo ip addr add 192.168.0.10/24 dev eno1.$VLAN\n
    \   ```\n\n(switchcolumn)\n<Message type=\"requirement\">\nTo perform the following
    steps, you must first ensure that:\n\n   - You have a [Scaleway account](https://console.scaleway.com/)\n
    \  - You have created an [API key](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/)
    and that the API key has sufficient [IAM permissions](https://www.scaleway.com/en/docs/identity-and-access-management/iam/reference-content/permission-sets/)
    to perform the actions described on this page\n   - You have [installed `curl`](https://curl.se/download.html)\n</Message>\n(switchcolumn)\n##
    Technical information\n\n### Pagination\n\nMost listing requests receive a paginated
    response. Requests against paginated endpoints accept two `query` arguments:\n\n-
    `page`, a positive integer to choose which page to return.\n- `page_size`, a positive
    integer lower or equal to 100 to select the number of items to return per page.
    The default value is `20`.\n\nPaginated endpoints usually also accept filters
    to search and sort results. These filters are documented along each endpoint documentation.\n\n###
    Availability Zones\n\nPrivate Networks for Apple silicon servers can be deployed
    in the following Availability Zones:\n\n| Name      | API ID                           |\n|-----------|----------------------------------|\n|
    Paris     | `fr-par-1` `fr-par-3`            |\n\n## Technical limitations\n\n-
    You need to configure a VLAN manually, using the Apple silicon server interface\n-
    The bandwidth is limited to 1Gbps inside the Private Network\n- You can configure
    up to 8 Private Networks per server\n- Broadcast and multicast traffic, while
    supported, are rate-limited\n\n## Going further\n\nFor more help using Private
    Networks on Apple silicon servers, check out the following resources:\n- Our [main
    documentation](https://www.scaleway.com/en/docs/bare-metal/apple-silicon/how-to/use-private-networks/)\n-
    The #virtual-private-cloud channel on our [Slack Community](https://www.scaleway.com/en/docs/tutorials/scaleway-slack-community/)\n-
    Our [support ticketing system](https://www.scaleway.com/en/docs/console/my-account/how-to/open-a-support-ticket)."
  version: v1alpha1
servers:
- url: https://api.scaleway.com
tags:
- name: Private Networks
  description: |
    A Private Network allows you to interconnect your resources
    in an isolated and private
    network. Network reachability is limited to the
    resources that are in the same VPC.

    Note that a resource can be a part of multiple Private Networks.
components:
  schemas:
    scaleway.apple_silicon.v1alpha1.ListServerPrivateNetworksResponse:
      type: object
      properties:
        server_private_networks:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.apple_silicon.v1alpha1.ServerPrivateNetwork'
        total_count:
          type: integer
          format: uint64
      x-properties-order:
      - server_private_networks
      - total_count
    scaleway.apple_silicon.v1alpha1.ServerPrivateNetwork:
      type: object
      properties:
        id:
          type: string
          description: ID of the Server-to-Private Network mapping.
        project_id:
          type: string
          description: Private Network Project ID.
        server_id:
          type: string
          description: Apple silicon server ID.
        private_network_id:
          type: string
          description: Private Network ID.
        vlan:
          type: integer
          description: ID of the VLAN associated with the Private Network.
          format: uint32
          nullable: true
        status:
          type: string
          description: Configuration status of the Private Network.
          enum:
          - unknown_status
          - attaching
          - attached
          - error
          - detaching
          - locked
          default: unknown_status
        created_at:
          type: string
          description: Private Network creation date. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        updated_at:
          type: string
          description: Date the Private Network was last modified. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        ipam_ip_ids:
          type: array
          description: IPAM IP IDs of the server, if it has any.
          items:
            type: string
      x-properties-order:
      - id
      - project_id
      - server_id
      - private_network_id
      - vlan
      - status
      - created_at
      - updated_at
      - ipam_ip_ids
    scaleway.apple_silicon.v1alpha1.SetServerPrivateNetworksResponse:
      type: object
      properties:
        server_private_networks:
          type: array
          items:
            $ref: '#/components/schemas/scaleway.apple_silicon.v1alpha1.ServerPrivateNetwork'
      x-properties-order:
      - server_private_networks
    scaleway.std.StringsValue:
      type: array
      nullable: true
      items:
        type: string
  securitySchemes:
    scaleway:
      in: header
      name: X-Auth-Token
      type: apiKey
paths:
  /apple-silicon/v1alpha1/zones/{zone}/server-private-networks:
    get:
      tags:
      - Private Networks
      operationId: ListServerPrivateNetworks
      summary: List the Private Networks of a server
      description: List the Private Networks of an Apple silicon server.
      parameters:
      - in: path
        name: zone
        description: The zone you want to target
        required: true
        schema:
          type: string
          description: The zone you want to target
          enum:
          - fr-par-1
          - fr-par-3
      - in: query
        name: order_by
        description: Sort order for the returned Private Networks.
        schema:
          type: string
          description: Sort order for the returned Private Networks.
          enum:
          - created_at_asc
          - created_at_desc
          - updated_at_asc
          - updated_at_desc
          default: created_at_asc
      - in: query
        name: page
        description: Page number for the returned Private Networks.
        schema:
          type: integer
          description: Page number for the returned Private Networks.
          format: int32
      - in: query
        name: page_size
        description: Maximum number of Private Networks per page.
        schema:
          type: integer
          description: Maximum number of Private Networks per page.
          format: uint32
      - in: query
        name: server_id
        description: Filter Private Networks by server ID.
        schema:
          type: string
          description: Filter Private Networks by server ID.
      - in: query
        name: private_network_id
        description: Filter Private Networks by Private Network ID.
        schema:
          type: string
          description: Filter Private Networks by Private Network ID.
      - in: query
        name: organization_id
        description: Filter Private Networks by Organization ID.
        schema:
          type: string
          description: Filter Private Networks by Organization ID.
      - in: query
        name: project_id
        description: Filter Private Networks by Project ID.
        schema:
          type: string
          description: Filter Private Networks by Project ID.
      - in: query
        name: ipam_ip_ids
        description: Filter Private Networks by IPAM IP IDs.
        schema:
          type: array
          description: Filter Private Networks by IPAM IP IDs.
          items:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.apple_silicon.v1alpha1.ListServerPrivateNetworksResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/apple-silicon/v1alpha1/zones/{zone}/server-private-networks"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/apple-silicon/v1alpha1/zones/{zone}/server-private-networks" \
            X-Auth-Token:$SCW_SECRET_KEY
  /apple-silicon/v1alpha1/zones/{zone}/servers/{server_id}/private-networks:
    post:
      tags:
      - Private Networks
      operationId: AddServerPrivateNetwork
      summary: Add a server to a Private Network
      description: Add an Apple silicon server to a Private Network.
      parameters:
      - in: path
        name: zone
        description: The zone you want to target
        required: true
        schema:
          type: string
          description: The zone you want to target
          enum:
          - fr-par-1
          - fr-par-3
      - in: path
        name: server_id
        description: ID of the server.
        required: true
        schema:
          type: string
          description: ID of the server.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.apple_silicon.v1alpha1.ServerPrivateNetwork'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                private_network_id:
                  type: string
                  description: ID of the Private Network.
                ipam_ip_ids:
                  type: array
                  description: IPAM IDs of IPs to attach to the server.
                  items:
                    type: string
              required:
              - private_network_id
              x-properties-order:
              - private_network_id
              - ipam_ip_ids
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"private_network_id":"string"}' \
            "https://api.scaleway.com/apple-silicon/v1alpha1/zones/{zone}/servers/{server_id}/private-networks"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/apple-silicon/v1alpha1/zones/{zone}/servers/{server_id}/private-networks" \
            X-Auth-Token:$SCW_SECRET_KEY \
            private_network_id="string"
    put:
      tags:
      - Private Networks
      operationId: SetServerPrivateNetworks
      summary: Set multiple Private Networks on a server
      description: Configure multiple Private Networks on an Apple silicon server.
      parameters:
      - in: path
        name: zone
        description: The zone you want to target
        required: true
        schema:
          type: string
          description: The zone you want to target
          enum:
          - fr-par-1
          - fr-par-3
      - in: path
        name: server_id
        description: ID of the server.
        required: true
        schema:
          type: string
          description: ID of the server.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.apple_silicon.v1alpha1.SetServerPrivateNetworksResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                per_private_network_ipam_ip_ids:
                  type: object
                  description: Object where the keys are the IDs of Private Networks
                    and the values are arrays of IPAM IDs representing the IPs to
                    assign to this Apple silicon server on the Private Network. If
                    the array supplied for a Private Network is empty, the next available
                    IP from the Private Network's CIDR block will automatically be
                    used for attachment.
                  properties:
                    <per_private_network_ipam_ip_idKey>:
                      $ref: '#/components/schemas/scaleway.std.StringsValue'
                  additionalProperties: true
              required:
              - per_private_network_ipam_ip_ids
              x-properties-order:
              - per_private_network_ipam_ip_ids
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X PUT \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"per_private_network_ipam_ip_ids":{"\u003cper_private_network_ipam_ip_idKey\u003e":["string"]}}' \
            "https://api.scaleway.com/apple-silicon/v1alpha1/zones/{zone}/servers/{server_id}/private-networks"
      - lang: HTTPie
        source: |-
          http PUT "https://api.scaleway.com/apple-silicon/v1alpha1/zones/{zone}/servers/{server_id}/private-networks" \
            X-Auth-Token:$SCW_SECRET_KEY \
            per_private_network_ipam_ip_ids:='{"\u003cper_private_network_ipam_ip_idKey\u003e":["string"]}'
  /apple-silicon/v1alpha1/zones/{zone}/servers/{server_id}/private-networks/{private_network_id}:
    get:
      operationId: GetServerPrivateNetwork
      parameters:
      - in: path
        name: zone
        description: The zone you want to target
        required: true
        schema:
          type: string
          description: The zone you want to target
          enum:
          - fr-par-1
          - fr-par-3
      - in: path
        name: server_id
        required: true
        schema:
          type: string
      - in: path
        name: private_network_id
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.apple_silicon.v1alpha1.ServerPrivateNetwork'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/apple-silicon/v1alpha1/zones/{zone}/servers/{server_id}/private-networks/{private_network_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/apple-silicon/v1alpha1/zones/{zone}/servers/{server_id}/private-networks/{private_network_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    delete:
      tags:
      - Private Networks
      operationId: DeleteServerPrivateNetwork
      summary: Delete a Private Network
      parameters:
      - in: path
        name: zone
        description: The zone you want to target
        required: true
        schema:
          type: string
          description: The zone you want to target
          enum:
          - fr-par-1
          - fr-par-3
      - in: path
        name: server_id
        description: ID of the server.
        required: true
        schema:
          type: string
          description: ID of the server.
      - in: path
        name: private_network_id
        description: ID of the Private Network.
        required: true
        schema:
          type: string
          description: ID of the Private Network.
      responses:
        "204":
          description: ""
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/apple-silicon/v1alpha1/zones/{zone}/servers/{server_id}/private-networks/{private_network_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/apple-silicon/v1alpha1/zones/{zone}/servers/{server_id}/private-networks/{private_network_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
