openapi: 3.2.0 info: title: Oxide Region Affinity API description: API for interacting with the Oxide control plane contact: url: https://oxide.computer email: api@oxide.computer version: 2026081901.0.0 tags: - name: affinity description: Anti-affinity groups give control over instance placement. externalDocs: url: http://docs.oxide.computer/api/affinity paths: /v1/anti-affinity-groups: get: tags: - affinity summary: List anti-affinity groups operationId: anti_affinity_group_list parameters: - in: query name: limit description: Maximum number of items returned by a single call schema: type: - integer - 'null' format: uint32 minimum: 1 - in: query name: page_token description: Token returned by previous call to retrieve the subsequent page schema: type: - string - 'null' - in: query name: project description: Name or ID of the project schema: $ref: '#/components/schemas/NameOrId' - in: query name: sort_by schema: $ref: '#/components/schemas/NameOrIdSortMode' responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/AntiAffinityGroupResultsPage' 4XX: $ref: '#/components/responses/Error' 5XX: $ref: '#/components/responses/Error' x-dropshot-pagination: required: - project post: tags: - affinity summary: Create anti-affinity group operationId: anti_affinity_group_create parameters: - in: query name: project description: Name or ID of the project required: true schema: $ref: '#/components/schemas/NameOrId' requestBody: content: application/json: schema: $ref: '#/components/schemas/AntiAffinityGroupCreate' required: true responses: '201': description: successful creation content: application/json: schema: $ref: '#/components/schemas/AntiAffinityGroup' 4XX: $ref: '#/components/responses/Error' 5XX: $ref: '#/components/responses/Error' /v1/anti-affinity-groups/{anti_affinity_group}: get: tags: - affinity summary: Fetch anti-affinity group operationId: anti_affinity_group_view parameters: - in: query name: project description: Name or ID of the project schema: $ref: '#/components/schemas/NameOrId' - in: path name: anti_affinity_group description: Name or ID of the anti affinity group required: true schema: $ref: '#/components/schemas/NameOrId' responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/AntiAffinityGroup' 4XX: $ref: '#/components/responses/Error' 5XX: $ref: '#/components/responses/Error' put: tags: - affinity summary: Update anti-affinity group operationId: anti_affinity_group_update parameters: - in: query name: project description: Name or ID of the project schema: $ref: '#/components/schemas/NameOrId' - in: path name: anti_affinity_group description: Name or ID of the anti affinity group required: true schema: $ref: '#/components/schemas/NameOrId' requestBody: content: application/json: schema: $ref: '#/components/schemas/AntiAffinityGroupUpdate' required: true responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/AntiAffinityGroup' 4XX: $ref: '#/components/responses/Error' 5XX: $ref: '#/components/responses/Error' delete: tags: - affinity summary: Delete anti-affinity group operationId: anti_affinity_group_delete parameters: - in: query name: project description: Name or ID of the project schema: $ref: '#/components/schemas/NameOrId' - in: path name: anti_affinity_group description: Name or ID of the anti affinity group required: true schema: $ref: '#/components/schemas/NameOrId' responses: '204': description: successful deletion 4XX: $ref: '#/components/responses/Error' 5XX: $ref: '#/components/responses/Error' /v1/anti-affinity-groups/{anti_affinity_group}/members: get: tags: - affinity summary: List anti-affinity group members operationId: anti_affinity_group_member_list parameters: - in: query name: limit description: Maximum number of items returned by a single call schema: type: - integer - 'null' format: uint32 minimum: 1 - in: query name: page_token description: Token returned by previous call to retrieve the subsequent page schema: type: - string - 'null' - in: query name: project description: Name or ID of the project schema: $ref: '#/components/schemas/NameOrId' - in: query name: sort_by schema: $ref: '#/components/schemas/NameOrIdSortMode' - in: path name: anti_affinity_group description: Name or ID of the anti affinity group required: true schema: $ref: '#/components/schemas/NameOrId' responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/AntiAffinityGroupMemberResultsPage' 4XX: $ref: '#/components/responses/Error' 5XX: $ref: '#/components/responses/Error' x-dropshot-pagination: required: [] /v1/anti-affinity-groups/{anti_affinity_group}/members/instance/{instance}: get: tags: - affinity summary: Fetch anti-affinity group member operationId: anti_affinity_group_member_instance_view parameters: - in: query name: project description: Name or ID of the project schema: $ref: '#/components/schemas/NameOrId' - in: path name: anti_affinity_group required: true schema: $ref: '#/components/schemas/NameOrId' - in: path name: instance required: true schema: $ref: '#/components/schemas/NameOrId' responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/AntiAffinityGroupMember' 4XX: $ref: '#/components/responses/Error' 5XX: $ref: '#/components/responses/Error' post: tags: - affinity summary: Add member to anti-affinity group operationId: anti_affinity_group_member_instance_add parameters: - in: query name: project description: Name or ID of the project schema: $ref: '#/components/schemas/NameOrId' - in: path name: anti_affinity_group required: true schema: $ref: '#/components/schemas/NameOrId' - in: path name: instance required: true schema: $ref: '#/components/schemas/NameOrId' responses: '201': description: successful creation content: application/json: schema: $ref: '#/components/schemas/AntiAffinityGroupMember' 4XX: $ref: '#/components/responses/Error' 5XX: $ref: '#/components/responses/Error' delete: tags: - affinity summary: Remove member from anti-affinity group operationId: anti_affinity_group_member_instance_delete parameters: - in: query name: project description: Name or ID of the project schema: $ref: '#/components/schemas/NameOrId' - in: path name: anti_affinity_group required: true schema: $ref: '#/components/schemas/NameOrId' - in: path name: instance required: true schema: $ref: '#/components/schemas/NameOrId' responses: '204': description: successful deletion 4XX: $ref: '#/components/responses/Error' 5XX: $ref: '#/components/responses/Error' components: schemas: AffinityPolicy: description: 'Affinity policy used to describe "what to do when a request cannot be satisfied" Used for both Affinity and Anti-Affinity Groups' oneOf: - description: 'If the affinity request cannot be satisfied, allow it anyway. This enables a "best-effort" attempt to satisfy the affinity policy.' type: string enum: - allow - description: If the affinity request cannot be satisfied, fail explicitly. type: string enum: - fail AntiAffinityGroupUpdate: description: Updateable properties of an `AntiAffinityGroup` type: object properties: description: type: - string - 'null' name: allOf: - $ref: '#/components/schemas/Name' InstanceState: description: 'Running state of an Instance (primarily: booted or stopped) This typically reflects whether it''s starting, running, stopping, or stopped, but also includes states related to the Instance''s lifecycle' oneOf: - description: The instance is being created. type: string enum: - creating - description: The instance is currently starting up. type: string enum: - starting - description: The instance is currently running. type: string enum: - running - description: The instance has been requested to stop and a transition to "Stopped" is imminent. type: string enum: - stopping - description: The instance is currently stopped. type: string enum: - stopped - description: The instance is in the process of rebooting - it will remain in the "rebooting" state until the VM is starting once more. type: string enum: - rebooting - description: The instance is in the process of migrating - it will remain in the "migrating" state until the migration process is complete and the destination propolis is ready to continue execution. type: string enum: - migrating - description: The instance is attempting to recover from a failure. type: string enum: - repairing - description: The instance has encountered a failure. type: string enum: - failed - description: The instance has been deleted. type: string enum: - destroyed NameOrId: oneOf: - title: id allOf: - type: string format: uuid - title: name allOf: - $ref: '#/components/schemas/Name' FailureDomain: description: Describes the scope of affinity for the purposes of co-location. oneOf: - description: Instances are considered co-located if they are on the same sled type: string enum: - sled Name: title: A name unique within the parent collection description: Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and '-', and may not end with a '-'. Names cannot be a UUID, but they may contain a UUID. They can be at most 63 characters long. type: string pattern: ^(?![0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)^[a-z]([a-zA-Z0-9-]*[a-zA-Z0-9]+)?$ minLength: 1 maxLength: 63 AntiAffinityGroup: description: View of an Anti-Affinity Group type: object properties: description: description: Human-readable free-form text about a resource type: string failure_domain: $ref: '#/components/schemas/FailureDomain' id: description: Unique, immutable, system-controlled identifier for each resource type: string format: uuid name: description: Unique, mutable, user-controlled identifier for each resource allOf: - $ref: '#/components/schemas/Name' policy: $ref: '#/components/schemas/AffinityPolicy' project_id: type: string format: uuid time_created: description: Timestamp when this resource was created type: string format: date-time time_modified: description: Timestamp when this resource was last modified type: string format: date-time required: - description - failure_domain - id - name - policy - project_id - time_created - time_modified AntiAffinityGroupResultsPage: description: A single page of results type: object properties: items: description: list of items on this page of results type: array items: $ref: '#/components/schemas/AntiAffinityGroup' next_page: description: token used to fetch the next page of results (if any) type: - string - 'null' required: - items AntiAffinityGroupCreate: description: Create-time parameters for an `AntiAffinityGroup` type: object properties: description: type: string failure_domain: $ref: '#/components/schemas/FailureDomain' name: $ref: '#/components/schemas/Name' policy: $ref: '#/components/schemas/AffinityPolicy' required: - description - failure_domain - name - policy AntiAffinityGroupMemberResultsPage: description: A single page of results type: object properties: items: description: list of items on this page of results type: array items: $ref: '#/components/schemas/AntiAffinityGroupMember' next_page: description: token used to fetch the next page of results (if any) type: - string - 'null' required: - items AntiAffinityGroupMember: description: 'A member of an Anti-Affinity Group Membership in a group is not exclusive - members may belong to multiple affinity / anti-affinity groups. Anti-Affinity Groups can contain up to 32 members.' oneOf: - description: 'An instance belonging to this group Instances can belong to up to 16 anti-affinity groups.' type: object properties: type: type: string enum: - instance value: type: object properties: id: type: string format: uuid name: $ref: '#/components/schemas/Name' run_state: $ref: '#/components/schemas/InstanceState' required: - id - name - run_state required: - type - value Error: description: Error information from a response. type: object properties: error_code: type: string message: type: string request_id: type: string required: - message - request_id NameOrIdSortMode: description: Supported set of sort modes for scanning by name or id oneOf: - description: Sort in increasing order of "name" type: string enum: - name_ascending - description: Sort in decreasing order of "name" type: string enum: - name_descending - description: Sort in increasing order of "id" type: string enum: - id_ascending responses: Error: description: Error content: application/json: schema: $ref: '#/components/schemas/Error'