{ "consumes": [ "application/json" ], "produces": [ "application/json" ], "schemes": [ "https" ], "swagger": "2.0", "info": { "description": "The API Gateway exposes all publicly available API endpoints for Crusoe Cloud products.", "title": "Crusoe Cloud API Gateway", "version": "v1alpha2" }, "host": "api.crusoecloud.com", "basePath": "/v1alpha2", "paths": { "/compute/vms/instances": { "get": { "tags": [ "VMs" ], "summary": "Retrieve details about all VMs that the logged in user owns or has access to.", "operationId": "getInstances", "responses": { "200": { "$ref": "#/responses/instancesGetResponse" }, "401": { "$ref": "#/responses/authError" }, "500": { "$ref": "#/responses/serverError" } } }, "post": { "tags": [ "VMs" ], "summary": "Create a new VM instance owned by the logged in user.", "operationId": "createInstance", "parameters": [ { "name": "Body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/InstancesPostRequest" } } ], "responses": { "200": { "$ref": "#/responses/instancesPatchPostDeleteResponse" }, "400": { "$ref": "#/responses/badReqError" }, "401": { "$ref": "#/responses/authError" }, "403": { "$ref": "#/responses/permissionsError" }, "500": { "$ref": "#/responses/serverError" } } } }, "/compute/vms/instances/operations": { "get": { "description": "This resource retrieves information about the status of asynchronous operations initiated by\nthe instances resource. All operations that are either in-flight or completed but not yet\nqueried will be returned.", "tags": [ "VMs" ], "summary": "Get status of asynchronous operations", "operationId": "getComputeVMsInstancesOperations", "parameters": [ { "type": "string", "example": "452580d7-41d1-4b63-b4d7-4e4e21e95f96", "x-go-name": "ResourceID", "name": "resource_id", "in": "query" } ], "responses": { "200": { "$ref": "#/responses/getComputeVMsInstancesOperationsResponse" }, "401": { "$ref": "#/responses/authError" }, "403": { "$ref": "#/responses/permissionsError" }, "500": { "$ref": "#/responses/serverError" } } } }, "/compute/vms/instances/operations/{operation_id}": { "get": { "description": "This resource retrieves information about the status of an asynchronous operation initiated by\nthe instances resource. Only information about the operation specified in the path will be returned,\nor an HTTP 403 will be returned if the operation does not exist, was not initiated by the logged\nin user, or has expired.", "tags": [ "VMs" ], "summary": "Get status of a single asynchronous operation", "operationId": "getComputeVMsInstancesOperation", "parameters": [ { "type": "string", "x-go-name": "OperationID", "name": "operation_id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/getComputeVMsInstancesOperationsResponse" }, "400": { "$ref": "#/responses/badReqError" }, "401": { "$ref": "#/responses/authError" }, "403": { "$ref": "#/responses/permissionsError" }, "500": { "$ref": "#/responses/serverError" } } } }, "/compute/vms/instances/{vm_id}": { "delete": { "tags": [ "VMs" ], "summary": "Delete a VM that the logged in user owns.", "operationId": "deleteInstance", "parameters": [ { "type": "string", "x-go-name": "VMID", "name": "vm_id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/instancesPatchPostDeleteResponse" }, "401": { "$ref": "#/responses/authError" }, "403": { "$ref": "#/responses/permissionsError" }, "500": { "$ref": "#/responses/serverError" } } }, "patch": { "tags": [ "VMs" ], "summary": "Change the state of a VM the logged in user owns.", "operationId": "updateInstance", "parameters": [ { "name": "Body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/InstancesPatchRequest" } }, { "type": "string", "x-go-name": "VMID", "name": "vm_id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/instancesPatchPostDeleteResponse" }, "400": { "$ref": "#/responses/badReqError" }, "401": { "$ref": "#/responses/authError" }, "403": { "$ref": "#/responses/permissionsError" }, "500": { "$ref": "#/responses/serverError" } } } }, "/compute/vms/types": { "get": { "tags": [ "VMs" ], "summary": "Retrieve information about the types of VMs that are available to purchase along with their prices.", "operationId": "getVMTypes", "responses": { "200": { "$ref": "#/responses/typesGetResponse" }, "401": { "$ref": "#/responses/authError" }, "500": { "$ref": "#/responses/serverError" } } } }, "/organizations/billing/intent": { "get": { "tags": [ "Billing" ], "summary": "Retrieve an intent to facilitate a Stripe action.", "operationId": "getBillingIntent", "parameters": [ { "type": "string", "example": "ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab", "x-go-name": "OrgID", "name": "org_id", "in": "query", "required": true }, { "type": "string", "example": "dashboard", "x-go-name": "Type", "name": "intent_type", "in": "query", "required": true } ], "responses": { "200": { "$ref": "#/responses/billingIntentGetResponse" }, "400": { "$ref": "#/responses/badReqError" }, "401": { "$ref": "#/responses/authError" }, "403": { "$ref": "#/responses/permissionsError" }, "500": { "$ref": "#/responses/serverError" } } } }, "/organizations/entities": { "get": { "tags": [ "Entities" ], "summary": "Retrieve details about all active organizations the logged in user belongs to.", "operationId": "getOrganizations", "responses": { "200": { "$ref": "#/responses/organizationsGetResponse" }, "401": { "$ref": "#/responses/authError" }, "500": { "$ref": "#/responses/serverError" } } }, "put": { "description": "A successful response from this resource will contain the updated organization details.", "tags": [ "Entities" ], "summary": "Update details for an organization that the logged in user owns.", "operationId": "updateOrganization", "parameters": [ { "type": "string", "example": "ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab", "x-go-name": "OrgID", "name": "org_id", "in": "query", "required": true }, { "name": "Body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EntitiesPutPostRequest" } } ], "responses": { "200": { "$ref": "#/responses/organizationsPutPostResponse" }, "400": { "$ref": "#/responses/badReqError" }, "401": { "$ref": "#/responses/authError" }, "403": { "$ref": "#/responses/permissionsError" }, "500": { "$ref": "#/responses/serverError" } } }, "post": { "description": "A successful response from this resource will contain the json encoded organization details.", "tags": [ "Entities" ], "summary": "Create a new organization owned by the logged in user.", "operationId": "createOrganization", "parameters": [ { "name": "Body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EntitiesPutPostRequest" } } ], "responses": { "200": { "$ref": "#/responses/organizationsPutPostResponse" }, "401": { "$ref": "#/responses/authError" }, "500": { "$ref": "#/responses/serverError" } } }, "delete": { "description": "Delete operations will cascade to roles and VMs, and all members will be removed from the organization.", "tags": [ "Entities" ], "summary": "Delete an organization owned by the logged in user.", "operationId": "deleteOrganization", "parameters": [ { "type": "string", "example": "ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab", "x-go-name": "OrgID", "name": "org_id", "in": "query", "required": true } ], "responses": { "200": { "$ref": "#/responses/emptyResponse" }, "401": { "$ref": "#/responses/authError" }, "403": { "$ref": "#/responses/permissionsError" }, "500": { "$ref": "#/responses/serverError" } } } }, "/organizations/entities/membership": { "get": { "tags": [ "Entities" ], "summary": "Retrieve the list of users who are members of an organization (or have been invited) owned by the logged in user.", "operationId": "getOrganizationsMembership", "responses": { "200": { "$ref": "#/responses/entitiesMembershipGetResponse" }, "400": { "$ref": "#/responses/badReqError" }, "401": { "$ref": "#/responses/authError" }, "403": { "$ref": "#/responses/permissionsError" }, "500": { "$ref": "#/responses/serverError" } } }, "put": { "description": "For inviting and removing users from an organization, the logged in user must be the owner of the organization.\nFor accepting an invite, the logged in user must have been invited to the organization.", "tags": [ "Entities" ], "summary": "Update the membership for an organization, as well as granting permissions to existing members.", "operationId": "updateOrganizationsMembership", "parameters": [ { "name": "Body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EntitiesMembershipPutRequest" } } ], "responses": { "200": { "$ref": "#/responses/emptyResponse" }, "401": { "$ref": "#/responses/authError" }, "500": { "$ref": "#/responses/serverError" } } } }, "/organizations/prospects": { "post": { "tags": [ "Prospects" ], "summary": "Create a new prospective customer in Crusoe Cloud.", "operationId": "createProspect", "parameters": [ { "name": "Body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ProspectPostRequest" } } ], "responses": { "200": { "$ref": "#/responses/prospectPostResponse" }, "500": { "$ref": "#/responses/serverError" } } } }, "/organizations/roles": { "get": { "description": "If querying for roles within an organization, the logged in user must be the owner of the organization.", "tags": [ "Roles" ], "summary": "Retrieve details about roles that the logged in user belongs to or owns.", "operationId": "getRoles", "parameters": [ { "type": "string", "example": "ee2a6bc3-aed5-4756-8995-9990a53d3a17", "x-go-name": "OrgID", "name": "org_id", "in": "query" } ], "responses": { "200": { "$ref": "#/responses/rolesGetResponse" }, "401": { "$ref": "#/responses/authError" }, "500": { "$ref": "#/responses/serverError" } } }, "put": { "description": "Requests to this resource must contain the json-encoded representation of the changes they want to make to the role.\nCurrently only the role's name can be changed.", "tags": [ "Roles" ], "summary": "Update details for a role that the logged in user owns.", "operationId": "updateRole", "parameters": [ { "type": "string", "example": "f058d0db-2fa4-4cf2-8cf1-dfbcfe05a814", "x-go-name": "RoleID", "name": "role_id", "in": "query", "required": true }, { "name": "Body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/RolesPutRequest" } } ], "responses": { "200": { "$ref": "#/responses/rolesPutPostResponse" }, "400": { "$ref": "#/responses/badReqError" }, "401": { "$ref": "#/responses/authError" }, "403": { "$ref": "#/responses/permissionsError" }, "500": { "$ref": "#/responses/serverError" } } }, "post": { "description": "The logged in user must have the permission to create roles within the organization.\nA successful response from this resource contains details of the created role.", "tags": [ "Roles" ], "summary": "Create a new role that will be owned by the logged in user.", "operationId": "createRole", "parameters": [ { "name": "Body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/RolesPostRequest" } } ], "responses": { "200": { "$ref": "#/responses/rolesPutPostResponse" }, "400": { "$ref": "#/responses/badReqError" }, "401": { "$ref": "#/responses/authError" }, "403": { "$ref": "#/responses/permissionsError" }, "500": { "$ref": "#/responses/serverError" } } }, "delete": { "description": "Delete operations cascade to VMs created under that role.", "tags": [ "Roles" ], "summary": "Delete a role that the logged in user owns.", "operationId": "deleteRole", "parameters": [ { "type": "string", "example": "f058d0db-2fa4-4cf2-8cf1-dfbcfe05a814", "x-go-name": "RoleID", "name": "role_id", "in": "query", "required": true } ], "responses": { "200": { "$ref": "#/responses/emptyResponse" }, "401": { "$ref": "#/responses/authError" }, "403": { "$ref": "#/responses/permissionsError" }, "500": { "$ref": "#/responses/serverError" } } } }, "/organizations/roles/membership": { "get": { "tags": [ "Roles" ], "summary": "Retrieve the list of users who are members of a role the logged in user owns.", "operationId": "getRolesMembership", "parameters": [ { "type": "string", "example": "f058d0db-2fa4-4cf2-8cf1-dfbcfe05a814", "x-go-name": "RoleID", "name": "role_id", "in": "query", "required": true } ], "responses": { "200": { "$ref": "#/responses/rolesMembershipGetResponse" }, "400": { "$ref": "#/responses/badReqError" }, "401": { "$ref": "#/responses/authError" }, "403": { "$ref": "#/responses/permissionsError" }, "500": { "$ref": "#/responses/serverError" } } }, "put": { "description": "When removing a user, the association between the user and the role will be deleted.", "tags": [ "Roles" ], "summary": "Update the membership for a role, and supports adding and removing users.", "operationId": "updateRolesMembership", "parameters": [ { "type": "string", "example": "f058d0db-2fa4-4cf2-8cf1-dfbcfe05a814", "x-go-name": "RoleID", "name": "role_id", "in": "query", "required": true }, { "name": "Body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/RolesMembershipPutRequest" } } ], "responses": { "200": { "$ref": "#/responses/emptyResponse" }, "401": { "$ref": "#/responses/authError" }, "500": { "$ref": "#/responses/serverError" } } } }, "/users/identities": { "get": { "tags": [ "Identities" ], "summary": "Retrieve user details for the logged in user.", "operationId": "getUserIdentity", "responses": { "200": { "$ref": "#/responses/usersGetResponse" }, "401": { "$ref": "#/responses/authError" }, "500": { "$ref": "#/responses/serverError" } } }, "put": { "description": "A successful response from this resource wil contain the updated user details.", "tags": [ "Identities" ], "summary": "Update user details for the logged in user.", "operationId": "updateUserIdentity", "parameters": [ { "name": "Body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Identity" } } ], "responses": { "200": { "$ref": "#/responses/usersPutResponse" }, "401": { "$ref": "#/responses/authError" }, "500": { "$ref": "#/responses/serverError" } } }, "delete": { "description": "Delete operations will cascade to all entities the user owns (organizations, roles, vms).", "tags": [ "Identities" ], "summary": "Delete the account for the logged in user.", "operationId": "deleteUserIdentity", "responses": { "200": { "$ref": "#/responses/emptyResponse" }, "401": { "$ref": "#/responses/authError" }, "403": { "$ref": "#/responses/permissionsError" }, "500": { "$ref": "#/responses/serverError" } } } }, "/users/ssh-keys": { "get": { "tags": [ "SSH-Keys" ], "summary": "Retrieve the list of SSH public keys registered to the logged in user.", "operationId": "getSSHKeys", "responses": { "200": { "$ref": "#/responses/getSSHKeysResponse" }, "401": { "$ref": "#/responses/authError" }, "500": { "$ref": "#/responses/serverError" } } }, "post": { "description": "A successful response from this resource wil contain the created SSH key details.", "tags": [ "SSH-Keys" ], "summary": "Register a new SSH public key to the logged in user.", "operationId": "createSSHKey", "parameters": [ { "name": "Body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/CreateSSHKeyRequest" } } ], "responses": { "200": { "$ref": "#/responses/createSSHKeysResponse" }, "400": { "$ref": "#/responses/badReqError" }, "401": { "$ref": "#/responses/authError" }, "500": { "$ref": "#/responses/serverError" } } }, "delete": { "tags": [ "SSH-Keys" ], "summary": "Delete an SSH public key registered to the logged in user.", "operationId": "deleteSSHKey", "parameters": [ { "type": "string", "example": "6e28cad3-98e6-47a9-a9fc-1cd83a7f25c1", "x-go-name": "ID", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "$ref": "#/responses/emptyResponse" }, "400": { "$ref": "#/responses/badReqError" }, "401": { "$ref": "#/responses/authError" }, "404": { "$ref": "#/responses/notFoundError" }, "500": { "$ref": "#/responses/serverError" } } } }, "/users/tokens": { "get": { "tags": [ "Tokens" ], "summary": "Retrieve all active/expired API tokens for the logged in user.", "operationId": "getTokens", "responses": { "200": { "$ref": "#/responses/tokensGetResponse" }, "401": { "$ref": "#/responses/authError" }, "500": { "$ref": "#/responses/serverError" } } }, "post": { "description": "A successful response from this resource will contain json-encoded details of API token.\nThis is the only time the customer will be able to view the secret key associated with the token.", "tags": [ "Tokens" ], "summary": "Create a new token owned by the logged in user.", "operationId": "createToken", "parameters": [ { "name": "Body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/CreateTokenRequest" } } ], "responses": { "200": { "$ref": "#/responses/tokensPostResponse" }, "401": { "$ref": "#/responses/authError" }, "500": { "$ref": "#/responses/serverError" } } }, "delete": { "tags": [ "Tokens" ], "summary": "Delete an API token owned by the logged in user.", "operationId": "deleteToken", "parameters": [ { "type": "string", "example": "WTUzcGibQ82y9_01h4MCdQ", "x-go-name": "AccessKey", "name": "access_key", "in": "query", "required": true } ], "responses": { "200": { "$ref": "#/responses/emptyResponse" }, "401": { "$ref": "#/responses/authError" }, "403": { "$ref": "#/responses/permissionsError" }, "500": { "$ref": "#/responses/serverError" } } } } }, "definitions": { "Billing": { "type": "object", "title": "Billing contains information about the billing status of an organization.", "properties": { "balance": { "type": "string", "x-go-name": "Balance", "example": "$1000.00" }, "delinquent": { "type": "boolean", "x-go-name": "Delinquent", "example": false }, "has_valid_payment_method": { "type": "boolean", "x-go-name": "HasValidPaymentMethod", "example": true } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "BillingIntentGetResponse": { "type": "object", "title": "BillingIntentGetResponse is the response type for Get requests to the entities/billing/intent endpoint.", "properties": { "intent": { "type": "string", "x-go-name": "Intent", "example": "https://billing.stripe.com/session/{SESSION_SECRET}" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "CreateSSHKeyRequest": { "type": "object", "required": [ "name", "public_key" ], "properties": { "name": { "type": "string", "x-go-name": "Name", "example": "John Doe" }, "public_key": { "type": "string", "x-go-name": "PublicKey", "example": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICpuH/fqCFLbAConChyVH6rZzSaxlnHSwQk6qvtPsf5E" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "CreateSSHKeyResponse": { "type": "object", "properties": { "ssh_key": { "$ref": "#/definitions/SSHKey" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "CreateTokenRequest": { "type": "object", "required": [ "alias", "expires_at" ], "properties": { "alias": { "type": "string", "x-go-name": "Alias", "example": "token1" }, "expires_at": { "type": "string", "x-go-name": "ExpiresAt", "example": "2021-12-03T19:58:34Z" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "EntitiesGetResponse": { "type": "object", "title": "EntitiesGetResponse is the response type for GET requests to the entities endpoint.", "properties": { "entities": { "type": "array", "items": { "$ref": "#/definitions/Entity" }, "x-go-name": "Entities" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "EntitiesMembershipGetResponse": { "type": "object", "title": "EntitiesMembershipGetResponse is the response type for GET requests to the entities.membership endpoint.", "properties": { "membership": { "type": "array", "items": { "$ref": "#/definitions/Member" }, "x-go-name": "Membership" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "EntitiesMembershipPutRequest": { "type": "object", "title": "EntitiesMembershipPutRequest is the request type for PUT requests to the entities.membership endpoint.", "required": [ "remove", "grant" ], "properties": { "accept": { "type": "boolean", "x-go-name": "Accept", "example": true }, "grant": { "type": "array", "items": { "$ref": "#/definitions/RelationUpdate" }, "x-go-name": "RelationUpdates" }, "invite": { "type": "array", "items": { "$ref": "#/definitions/Invitee" }, "x-go-name": "InviteEmails" }, "remove": { "type": "array", "items": { "type": "string" }, "x-go-name": "UsersToRemove", "example": [ "aacfd263-9074-4d0a-93ae-d10551ad1094" ] } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "EntitiesPutPostRequest": { "type": "object", "title": "EntitiesPutPostRequest is the request type for PUT and POST requests to the entities endpoint.", "required": [ "organization_name" ], "properties": { "organization_name": { "type": "string", "x-go-name": "OrganizationName", "example": "Crusoe Energy" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "EntitiesPutPostResponse": { "type": "object", "title": "EntitiesPutPostResponse is the reesponse type for PUT and POST requests to the entities endpoint.", "properties": { "entity": { "$ref": "#/definitions/Entity" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "Entity": { "type": "object", "title": "Entity contains identifying information for an organization.", "properties": { "billing": { "$ref": "#/definitions/Billing" }, "id": { "type": "string", "x-go-name": "ID", "example": "ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab" }, "name": { "type": "string", "x-go-name": "Name", "example": "Crusoe Energy" }, "relation": { "type": "string", "x-go-name": "Relation", "example": "owner" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "ErrorBody": { "type": "object", "properties": { "code": { "type": "string", "x-go-name": "Code", "example": "401" }, "message": { "type": "string", "x-go-name": "Message", "example": "bad_credential" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "Fingerprints": { "type": "object", "properties": { "md5": { "type": "string", "x-go-name": "MD5", "example": "bf:60:fa:cc:9f:42:1f:5e:23:9e:ed:d2:69:d8:76:93" }, "sha256": { "type": "string", "x-go-name": "SHA256", "example": "tARFxQkVHeqm6TzqpI897QsHVdgZlxgL2/YhVltmEUk" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "GeneratedToken": { "description": "These are the fields returned from a PUT request.", "type": "object", "title": "GeneratedToken contains the Traits Island stores for a Token inside of Kratos.", "properties": { "access_key": { "type": "string", "x-go-name": "AccessKey", "example": "R7p5XctCQMuGlpVBmVdqzA" }, "alias": { "type": "string", "x-go-name": "Alias", "example": "newtoken" }, "created_at": { "type": "string", "x-go-name": "CreatedAt", "example": "2021-11-03T22:16:27Z" }, "expires_at": { "type": "string", "x-go-name": "ExpiresAt", "example": "2021-12-03T19:58:34Z" }, "secret_key": { "type": "string", "x-go-name": "SecretKey", "example": "HrbZ3VTUb2YNAq53Md1EsA" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "GetSSHKeyResponse": { "type": "object", "properties": { "ssh_keys": { "type": "array", "items": { "$ref": "#/definitions/SSHKey" }, "x-go-name": "SSHKeys" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "Identity": { "description": "Identity contains the Traits Island stores for a User inside of Kratos. These are\nthe fields returned from a GET or PUT request.", "type": "object", "required": [ "email" ], "properties": { "email": { "type": "string", "x-go-name": "Email", "example": "john.doe@crusoeenergy.com" }, "name": { "type": "string", "x-go-name": "Name", "example": "John Doe" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "Instance": { "type": "object", "title": "Instance contains identifying information about a vm instance for vms.instances endpoints.", "properties": { "commitment_end": { "type": "string", "x-go-name": "CommitmentEnd", "example": "2021-12-03T19:58:34Z" }, "commitment_period": { "type": "integer", "format": "int64", "x-go-name": "CommitmentPeriod", "example": 6 }, "created_at": { "type": "string", "x-go-name": "CreatedAt", "example": "2021-12-03T19:58:34Z" }, "id": { "type": "string", "x-go-name": "ID", "example": "ca39e669-47ee-456b-968d-303234fbf99f" }, "name": { "type": "string", "x-go-name": "Name", "example": "my-first-vm" }, "product_name": { "type": "string", "x-go-name": "ProductName", "example": "a100.2x" }, "role_id": { "type": "string", "x-go-name": "RoleID", "example": "09ae8411-0fbb-411c-898c-2b8f19622ae1" }, "ssh_destination": { "type": "string", "x-go-name": "SSHDestination", "example": "12.21.12.21:22" }, "state": { "type": "string", "x-go-name": "State", "example": "RUNNING" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "InstancesAsyncGetResponse": { "type": "object", "title": "InstancesAsyncGetResponse is the response type for GET requests to /compute/vms/instances.", "properties": { "instances": { "type": "array", "items": { "$ref": "#/definitions/Instance" }, "x-go-name": "Instances" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "InstancesAsyncPatchPostDeleteResponse": { "description": "InstancesAsyncPatchPostDeleteResponse is the response type for PATCH, POST, and DELETE\nrequests to the v1alpha2 vms.instances endpoint.", "type": "object", "properties": { "operation": { "$ref": "#/definitions/Operation" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "InstancesPatchRequest": { "type": "object", "title": "InstancesPatchRequest is the request type for PATCH requests to the vms.instances endpoint.", "required": [ "action" ], "properties": { "action": { "type": "string", "x-go-name": "Action", "example": "START" }, "commitment_period": { "type": "integer", "format": "int64", "x-go-name": "CommitmentPeriod", "example": 6 } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "InstancesPostRequest": { "type": "object", "title": "InstancesPostRequest is the request type for POST requests to the vms.instances endpoint.", "required": [ "product_name", "role_id", "ssh_public_key", "name" ], "properties": { "commitment_period": { "type": "integer", "format": "int64", "x-go-name": "CommitmentPeriod", "example": 6 }, "image_checksum": { "type": "string", "x-go-name": "ImageChecksum", "example": "120EA8A25E5D487BF68B5F7096440019" }, "image_id": { "type": "string", "x-go-name": "ImageID", "example": "9f161e28-b629-442c-951c-77c68199f36e" }, "name": { "type": "string", "x-go-name": "Name", "example": "my-first-vm" }, "product_name": { "type": "string", "x-go-name": "ProductName", "example": "a100.2x" }, "role_id": { "type": "string", "x-go-name": "RoleID", "example": "09ae8411-0fbb-411c-898c-2b8f19622ae1" }, "shutdown_script": { "type": "string", "x-go-name": "ShutdownScript", "example": "\"#!/bin/bash\\necho'goodbye'\"" }, "ssh_public_key": { "type": "string", "x-go-name": "SSHPublicKey", "example": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCspdG97nTS/h4PEPq2QD2RYVK1jxFXLFZuSDMI8Rtxpucl6LDZLOghEYoj13lxKQnGtcsM3Iu68lh+4YgZe7CbI6cc/TxPbeAX2HJTqDh0J7+GAlLBHK9tsepC0QlhIDiazJptOPDZ3cesCBXdxSnzEbhDaqgYOfl393cp1fCeOKRIDWEP3H9CM25dCbWF66sTDziLsojJ9dMnxhgKm9/JkZc5gYncLT/2Ey+VWfV9Fs65mGUrBbQOn3c8S/nEk6WRcYn4PFOnIp0Mz+Chb50iCJrW677pllLnkTGSU+4c0H9J5z4HDG0I+91RoiQ0QsayFTYO1JtSn+THLuq98V+D" }, "startup_script": { "type": "string", "x-go-name": "StartupScript", "example": "\"#!/bin/bash\\necho'hello'\"" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "Invitee": { "type": "object", "required": [ "email" ], "properties": { "email": { "type": "string", "x-go-name": "Email", "example": "bob@crusoeenergy.com" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "Member": { "type": "object", "title": "Member contains identifying information for a user who is a member of an organization or role.", "properties": { "id": { "type": "string", "x-go-name": "ID", "example": "d8f58dfd-dd86-4ee4-8f01-643e6d0f15bb" }, "name": { "type": "string", "x-go-name": "Name", "example": "John Doe" }, "relation": { "type": "string", "x-go-name": "Relation", "example": "member" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "Operation": { "description": "Individual resources that use Operations should populate the `metadata` field\nwith resource-specific information.", "type": "object", "title": "Operation contains the common fields for all Operation API objects.", "properties": { "completed_at": { "type": "string", "x-go-name": "CompletedAt", "example": "2021-12-03T19:59:34Z" }, "metadata": { "type": "object", "x-go-name": "Metadata", "example": {} }, "operation_id": { "type": "string", "x-go-name": "ID", "example": "F6EF489C-086E-458D-B812-7962964A28C9" }, "result": { "type": "object", "x-go-name": "Result", "example": {} }, "started_at": { "type": "string", "x-go-name": "StartedAt", "example": "2021-12-03T19:58:34Z" }, "state": { "type": "string", "x-go-name": "State", "example": "IN_PROGRESS" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "OperationsGetResponse": { "type": "object", "title": "OperationsGetResponse is the common response type for GET requests to operations endpoints.", "properties": { "operations": { "type": "array", "items": { "$ref": "#/definitions/Operation" }, "x-go-name": "Operations" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "ProspectPostRequest": { "type": "object", "title": "ProspectPostRequest is the request type for POST requests to the prospects endpoint.", "required": [ "email", "name", "company", "use_case", "source" ], "properties": { "company": { "type": "string", "x-go-name": "Company", "example": "crusoe" }, "email": { "type": "string", "x-go-name": "Email", "example": "john@crusoeenergy.com" }, "name": { "type": "string", "x-go-name": "Name", "example": "john" }, "source": { "type": "string", "x-go-name": "Source", "example": "portal" }, "use_case": { "type": "string", "x-go-name": "UseCase", "example": "training model to minimize energy usage" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "ProspectPostResponse": { "type": "object", "title": "ProspectPostResponse is the response type for POST requests to the prospects endpoint.", "properties": { "success": { "type": "boolean", "x-go-name": "Success", "example": true } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "RelationUpdate": { "type": "object", "title": "RelationUpdate contains information needed to grant a user permissions.", "required": [ "id", "relation" ], "properties": { "id": { "type": "string", "x-go-name": "ID", "example": "465a1fb5-f37e-4483-ad36-bf994efcb170" }, "relation": { "type": "string", "x-go-name": "Relation", "example": "member" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "Role": { "type": "object", "title": "Role contains identifying information for a role.", "properties": { "id": { "type": "string", "x-go-name": "ID", "example": "09ae8411-0fbb-411c-898c-2b8f19622ae1" }, "name": { "type": "string", "x-go-name": "Name", "example": "Admin" }, "organization_id": { "type": "string", "x-go-name": "OrganizationID", "example": "ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab" }, "relation": { "type": "string", "x-go-name": "Relation", "example": "owner" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "RolesGetResponse": { "type": "object", "title": "RolesGetResponse is the response type for GET requests to the roles endpoint.", "properties": { "roles": { "type": "array", "items": { "$ref": "#/definitions/Role" }, "x-go-name": "Roles" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "RolesMembershipGetResponse": { "title": "RolesMembershipGetResponse is the response type for GET requests to the roles.membership endpoint.", "$ref": "#/definitions/EntitiesMembershipGetResponse" }, "RolesMembershipPutRequest": { "type": "object", "title": "RolesMembershipPutRequest is the request type for PUT requests to the roles.membership endpoint.", "required": [ "add", "remove", "grant" ], "properties": { "add": { "type": "array", "items": { "type": "string" }, "x-go-name": "UsersToAdd", "example": [ "05d42579-47a2-4739-beb5-aef5b90626a4" ] }, "grant": { "type": "array", "items": { "$ref": "#/definitions/RelationUpdate" }, "x-go-name": "RelationUpdates" }, "remove": { "type": "array", "items": { "type": "string" }, "x-go-name": "UsersToRemove", "example": [ "37021bb9-3620-42d9-ab46-da0ec3078769" ] } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "RolesPostRequest": { "type": "object", "title": "RolesPostRequest is the request type for POST requests to the roles endpoint.", "required": [ "organization_id", "name" ], "properties": { "name": { "type": "string", "x-go-name": "Name", "example": "Admin" }, "organization_id": { "type": "string", "x-go-name": "OrganizationID", "example": "ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "RolesPutPostResponse": { "type": "object", "title": "RolesPutPostResponse is the response type for PUT and POST requests to the roles endpoint.", "properties": { "role": { "$ref": "#/definitions/Role" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "RolesPutRequest": { "type": "object", "title": "RolesPutRequest is the request type for PUT requests to the roles endpoint.", "required": [ "name" ], "properties": { "name": { "type": "string", "x-go-name": "Name", "example": "Crusoe Energy" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "SSHKey": { "type": "object", "properties": { "created_at": { "type": "string", "x-go-name": "CreatedAt", "example": "2022-01-24T20:13:35.328Z" }, "fingerprints": { "$ref": "#/definitions/Fingerprints" }, "id": { "type": "string", "x-go-name": "ID", "example": "0b880f48-6a97-408f-8351-3cc30871e010" }, "name": { "type": "string", "x-go-name": "Name", "example": "public key 1" }, "public_key": { "type": "string", "x-go-name": "PublicKey", "example": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICpuH/fqCFLbAConChyVH6rZzSaxlnHSwQk6qvtPsf5E" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "TokenInfo": { "description": "These are the fields returned from a GET request.", "type": "object", "title": "TokenInfo contains the Traits Island stores for a Token inside of Kratos.", "properties": { "access_key": { "type": "string", "x-go-name": "AccessKey", "example": "Hm11C1coQZm2+Aihn9ofYg" }, "alias": { "type": "string", "x-go-name": "Alias", "example": "token1" }, "created_at": { "type": "string", "x-go-name": "CreatedAt", "example": "2021-11-03T22:16:27Z" }, "expires_at": { "type": "string", "x-go-name": "ExpiresAt", "example": "2021-12-03T19:58:34Z" }, "last_used": { "type": "string", "x-go-name": "LastUsed", "example": "2021-11-03T22:22:55Z" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "TokensGetResponse": { "type": "object", "properties": { "tokens": { "type": "array", "items": { "$ref": "#/definitions/TokenInfo" }, "x-go-name": "Tokens" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "TokensPostResponse": { "type": "object", "properties": { "token": { "$ref": "#/definitions/GeneratedToken" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "Type": { "type": "object", "title": "Types an instance of an island cloud offering, used in the GET vms.types endpoint response.", "properties": { "product_name": { "type": "string", "x-go-name": "ProductName", "example": "a100.2x" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "TypesGetResponse": { "type": "object", "title": "TypesGetResponse is the response type for GET requests to the vms.types endpoint.", "properties": { "vm_types": { "type": "array", "items": { "$ref": "#/definitions/Type" }, "x-go-name": "Types" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" }, "UserResponse": { "description": "The Identity of a user is returned.", "type": "object", "title": "UserResponse is the return type from the GET and PUT handlers to User.", "properties": { "identity": { "$ref": "#/definitions/Identity" } }, "x-go-package": "gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers" } }, "responses": { "authError": { "description": "Error Authentication Failed", "schema": { "$ref": "#/definitions/ErrorBody" } }, "badReqError": { "description": "Error Bad Request", "schema": { "$ref": "#/definitions/ErrorBody" } }, "billingIntentGetResponse": { "description": "", "schema": { "$ref": "#/definitions/BillingIntentGetResponse" } }, "createSSHKeysResponse": { "description": "", "schema": { "$ref": "#/definitions/CreateSSHKeyResponse" } }, "emptyResponse": { "description": "Empty Response" }, "entitiesMembershipGetResponse": { "description": "", "schema": { "$ref": "#/definitions/EntitiesMembershipGetResponse" } }, "getComputeVMsInstancesOperationsResponse": { "description": "", "schema": { "$ref": "#/definitions/OperationsGetResponse" } }, "getSSHKeysResponse": { "description": "", "schema": { "$ref": "#/definitions/GetSSHKeyResponse" } }, "instancesGetResponse": { "description": "", "schema": { "$ref": "#/definitions/InstancesAsyncGetResponse" } }, "instancesPatchPostDeleteResponse": { "description": "", "schema": { "$ref": "#/definitions/InstancesAsyncPatchPostDeleteResponse" } }, "notFoundError": { "description": "Error Not Found", "schema": { "$ref": "#/definitions/ErrorBody" } }, "organizationsGetResponse": { "description": "", "schema": { "$ref": "#/definitions/EntitiesGetResponse" } }, "organizationsPutPostResponse": { "description": "", "schema": { "$ref": "#/definitions/EntitiesPutPostResponse" } }, "permissionsError": { "description": "Error Permissions", "schema": { "$ref": "#/definitions/ErrorBody" } }, "prospectPostResponse": { "description": "", "schema": { "$ref": "#/definitions/ProspectPostResponse" } }, "rolesGetResponse": { "description": "", "schema": { "$ref": "#/definitions/RolesGetResponse" } }, "rolesMembershipGetResponse": { "description": "", "schema": { "$ref": "#/definitions/RolesMembershipGetResponse" } }, "rolesPutPostResponse": { "description": "", "schema": { "$ref": "#/definitions/RolesPutPostResponse" } }, "serverError": { "description": "Error Internal Server", "schema": { "$ref": "#/definitions/ErrorBody" } }, "tokensGetResponse": { "description": "A successful response from this resource will contain json-encoded array of token details, excluding the secret key.", "schema": { "$ref": "#/definitions/TokensGetResponse" } }, "tokensPostResponse": { "description": "", "schema": { "$ref": "#/definitions/TokensPostResponse" } }, "typesGetResponse": { "description": "", "schema": { "$ref": "#/definitions/TypesGetResponse" } }, "usersGetResponse": { "description": "", "schema": { "$ref": "#/definitions/UserResponse" } }, "usersPutResponse": { "description": "", "schema": { "$ref": "#/definitions/UserResponse" } } }, "x-tagGroups": [ { "name": "Compute", "tags": [ "VMs" ] }, { "name": "Organizations", "tags": [ "Roles", "Billing", "Entities", "Prospects" ] }, { "name": "Users", "tags": [ "Identities", "SSH-Keys", "Tokens" ] } ] }