From 58873b64ab38b72330b976199fbf1dd71aa891da Mon Sep 17 00:00:00 2001 From: johanneswuerbach <864578+johanneswuerbach@users.noreply.github.com> Date: Mon, 4 Mar 2024 10:51:42 +0000 Subject: [PATCH] feat: update client --- docs/openapi.json | 2916 ++++++++++++++++++++++----------------------- 1 file changed, 1453 insertions(+), 1463 deletions(-) diff --git a/docs/openapi.json b/docs/openapi.json index 523106f..8837d2b 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.0.0", "info": { "title": "Humanitec API", - "version": "0.25.6", + "version": "0.25.7", "description": "# Introduction\nThe *Humanitec API* allows you to automate and integrate Humanitec into your developer and operational workflows.\nThe API is a REST based API. It is based around a set of concepts:\n\n* Core\n* External Resources\n* Sets and Deltas\n\n## Authentication\n\nAlmost all requests made to the Humanitec API require Authentication. See our [Developer Docs on API Authentication](https://developer.humanitec.com/platform-orchestrator/reference/api-references/#authentication) for instructions.\n\n## Content Types\nAll of the Humanitec API unless explicitly only accepts content types of `application/json` and will always return valid `application/json` or an empty response.\n\n## Response Codes\n### Success\nAny response code in the `2xx` range should be regarded as success.\n\n| **Code** | **Meaning** |\n| --- | --- |\n| `200` | Success |\n| `201` | Success (In future, `201` will be replaced by `200`) |\n| `204` | Success, but no content in response |\n\n_Note: We plan to simplify the interface by replacing 201 with 200 status codes._\n\n### Failure\nAny response code in the `4xx` should be regarded as an error which can be rectified by the client. `5xx` error codes indicate errors that cannot be corrected by the client.\n\n| **Code** | **Meaning** |\n| --- | --- |\n| `400` | General error. (Body will contain details) |\n| `401` | Attempt to access protected resource without `Authorization` Header. |\n| `403` | The `Bearer` or `JWT` does not grant access to the requested resource. |\n| `404` | Resource not found. |\n| `405` | Method not allowed |\n| `409` | Conflict. Usually indicated a resource with that ID already exists. |\n| `422` | Unprocessable Entity. The body was not valid JSON, was empty or contained an object different from what was expected. |\n| `429` | Too many requests - request rate limit has been reached. |\n| `500` | Internal Error. If it occurs repeatedly, contact support. |\n", "contact": { "name": "API Support", @@ -2447,13 +2447,13 @@ } } }, - "/orgs/{orgId}/apps/{appId}/users": { + "/orgs/{orgId}/apps/{appId}/envs/{envId}/rules": { "get": { "tags": [ "public", - "UserRole" + "AutomationRule" ], - "summary": "List Users with roles in an App", + "summary": "List all Automation Rules in an Environment.", "parameters": [ { "name": "orgId", @@ -2472,34 +2472,63 @@ "schema": { "type": "string" } + }, + { + "name": "envId", + "in": "path", + "description": "The Environment ID.\n\n", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "A list of Users and the roles they hold.\n\n", + "description": "A possibly empty array of Automation Rules\n\n", "content": { "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/UserRoleResponse" + "$ref": "#/components/schemas/AutomationRuleResponse" }, "type": "array" - } + }, + "example": [ + { + "active": true, + "artefacts_filter": [ + "http://registry.org/sample-service" + ], + "created_at": "2021-07-22T14:53:27Z", + "created_by": "0dbbdc88-b125-47f1-9a96-6c4c9d6ddc70", + "exclude_artefacts_filter": false, + "exclude_images_filter": false, + "id": "923486d012f20324", + "images_filter": [ + "sample-service" + ], + "match": "^pr-[0-9]+-.*$", + "match_ref": "^refs/heads/pr-[0-9]+-.*$", + "type": "update", + "update_to": "branch" + } + ] } } }, - "404": { - "description": "Object does not exist.\n\n" + "500": { + "description": "Internal Server error.\n\n" } - }, - "operationId": "listUserRolesInApp" + } }, "post": { "tags": [ "public", - "UserRole" + "AutomationRule" ], - "summary": "Adds a User to an Application with a Role", + "summary": "Create a new Automation Rule for an Environment.", + "description": "Items marked as deprecated are still supported (however not recommended) for use and are incompatible with properties of the latest api version. In particular an error is raised if `images_filter` (deprecated) and `artefacts_filter` are used in the same payload. The same is true for `exclude_images_filter` (deprecated) and `exclude_artefacts_filter`. `match` and `update_to` are still supported but will trigger an error if combined with `match_ref`.", "parameters": [ { "name": "orgId", @@ -2518,62 +2547,71 @@ "schema": { "type": "string" } + }, + { + "name": "envId", + "in": "path", + "description": "The Environment ID.\n\n", + "required": true, + "schema": { + "type": "string" + } } ], "requestBody": { - "description": "The user ID and the role\n\n", + "description": "The definition of the Automation Rule.\n\n", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserRoleRequest" + "$ref": "#/components/schemas/AutomationRuleRequest" }, "example": { - "id": "61048226-642c-438e-974f-ce5c013d94f8", - "role": "manager" + "active": true, + "artefacts_filter": [ + "http://registry.org/sample-service" + ], + "exclude_artefacts_filter": false, + "match_ref": "^refs/heads/pr-[0-9]+-.*$", + "type": "update" } } } }, "responses": { - "200": { - "description": "The user ID and associated role.\n\n", + "201": { + "description": "The AutomationRule\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserRoleResponse" + "$ref": "#/components/schemas/AutomationRuleResponse" } } } }, "400": { - "description": "The request was invalid or the payload malformed.\n\n", + "description": "The input was not a valid Automation Rule.\n\n", "content": { "application/json": { "schema": { - "type": "string", - "$ref": "#/components/schemas/HumanitecErrorResponse" + "$ref": "#/components/schemas/ErrorInfoResponse" } } } }, - "404": { - "description": "The specified Application was not found.\n\n" - }, "422": { - "description": "The request body was not parseable.\n\n" + "description": "The request body could not be processed.\n\n" } - }, - "operationId": "createUserRoleInApp" + } } }, - "/orgs/{orgId}/users": { + "/orgs/{orgId}/apps/{appId}/envs/{envId}/rules/{ruleId}": { "get": { "tags": [ "public", - "UserRole" + "AutomationRule" ], - "summary": "List Users with roles in an Organization", + "summary": "Get a specific Automation Rule for an Environment.", "parameters": [ { "name": "orgId", @@ -2583,34 +2621,76 @@ "schema": { "type": "string" } + }, + { + "name": "appId", + "in": "path", + "description": "The Application ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "envId", + "in": "path", + "description": "The Environment ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "ruleId", + "in": "path", + "description": "The Automation Rule ID.\n\n", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "A list of Users and the roles they hold.\n\n", + "description": "The AutomationRule\n\n", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/UserRoleResponse" - }, - "type": "array" + "$ref": "#/components/schemas/AutomationRuleResponse" + }, + "example": { + "active": true, + "artefacts_filter": [ + "http://registry.org/sample-service" + ], + "created_at": "2021-07-22T14:53:27Z", + "created_by": "0dbbdc88-b125-47f1-9a96-6c4c9d6ddc70", + "exclude_artefacts_filter": false, + "exclude_images_filter": false, + "id": "923486d012f20324", + "images_filter": [ + "sample-service" + ], + "match": "^pr-[0-9]+-.*$", + "match_ref": "^refs/heads/pr-[0-9]+-.*$", + "type": "update", + "update_to": "branch" } } } }, "404": { - "description": "Object does not exist.\n\n" + "description": "There is no automation rule with the supplied ID.\n\n" } - }, - "operationId": "listUserRolesInOrg" + } }, - "post": { + "put": { "tags": [ "public", - "UserProfile" + "AutomationRule" ], - "summary": "Creates a new service user.", + "summary": "Update an existing Automation Rule for an Environment.", + "description": "Items marked as deprecated are still supported (however not recommended) for use and are incompatible with properties of the latest api version. In particular an error is raised if `images_filter` (deprecated) and `artefacts_filter` are used in the same payload. The same is true for `exclude_images_filter` (deprecated) and `exclude_artefacts_filter`. `match` and `update_to` are still supported but will trigger an error if combined with `match_ref`.", "parameters": [ { "name": "orgId", @@ -2620,64 +2700,90 @@ "schema": { "type": "string" } + }, + { + "name": "appId", + "in": "path", + "description": "The Application ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "envId", + "in": "path", + "description": "The Environment ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "ruleId", + "in": "path", + "description": "The Automation Rule ID.\n\n", + "required": true, + "schema": { + "type": "string" + } } ], "requestBody": { - "description": "The user ID and the role\n\n", + "description": "The definition of the Automation Rule.\n\n", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NewServiceUserRequest" + "$ref": "#/components/schemas/AutomationRuleRequest" }, "example": { - "id": "61048226-642c-438e-974f-ce5c013d94f8", - "role": "manager", - "name": "CI Robot" + "active": true, + "artefacts_filter": [ + "http://registry.org/sample-service" + ], + "exclude_artefacts_filter": false, + "match_ref": "^refs/heads/pr-[0-9]+-.*$", + "type": "update" } } } }, "responses": { "200": { - "description": "The extended user profile of the user.\n\n", + "description": "The AutomationRule\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserProfileResponse" + "$ref": "#/components/schemas/AutomationRuleResponse" } } } }, "400": { - "description": "The request was invalid or the payload malformed.\n\n", + "description": "The input was not a valid Automation Rule.\n\n", "content": { "application/json": { "schema": { - "type": "string", - "$ref": "#/components/schemas/HumanitecErrorResponse" + "$ref": "#/components/schemas/ErrorInfoResponse" } } } }, - "422": { - "description": "The request body was not parseable.\n\n" + "404": { + "description": "There is no automation rule with the supplied ID.\n\n" }, - "403": { - "description": "Token is not valid for a user.\n\n" + "422": { + "description": "The request body could not be processed.\n\n" } - }, - "operationId": "createServiceUserInOrg" - } - }, - "/orgs/{orgId}/users/{userId}": { - "get": { + } + }, + "delete": { "tags": [ "public", - "UserRole" + "AutomationRule" ], - "summary": "Get the role of a User on an Organization", - "operationId": "getUserRoleInOrg", + "summary": "Delete Automation Rule from an Environment.", "parameters": [ { "name": "orgId", @@ -2689,9 +2795,27 @@ } }, { - "name": "userId", + "name": "appId", "in": "path", - "description": "The User ID\n\n", + "description": "The Application ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "envId", + "in": "path", + "description": "The Environment ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "ruleId", + "in": "path", + "description": "The Automation Rule ID.\n\n", "required": true, "schema": { "type": "string" @@ -2699,128 +2823,125 @@ } ], "responses": { - "200": { - "description": "The information on the user.\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserRoleResponse" - } - } - } - }, - "400": { - "description": "The request was invalid or the payload malformed.\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" - } - } - } + "204": { + "description": "The AutomationRule was deleted.\n\n" }, "404": { - "description": "Object does not exist.\n\n" + "description": "There is no automation rule with the supplied ID.\n\n" } } - }, - "delete": { + } + }, + "/orgs/{orgId}/apps/{appId}/deltas": { + "get": { "tags": [ "public", - "UserRole" + "Delta" ], - "summary": "Remove the role of a User on an Organization", - "operationId": "deleteUserRoleInOrg", + "summary": "List Deltas in an Application", "parameters": [ { - "name": "orgId", - "in": "path", - "description": "The Organization ID.\n\n", - "required": true, + "$ref": "#/components/parameters/orgIdPathParam" + }, + { + "$ref": "#/components/parameters/appIdPathParam" + }, + { + "name": "archived", + "in": "query", + "description": "If true, return archived Deltas.\n\n", "schema": { - "type": "string" + "type": "boolean" } }, { - "name": "userId", - "in": "path", - "description": "The User ID\n\n", - "required": true, + "name": "env", + "in": "query", + "description": "Only return Deltas associated with the specified Environment.\n\n", "schema": { - "type": "string" + "type": "string", + "pattern": "^[a-z0-9](?:-?[a-z0-9]+)+$" } } ], "responses": { - "204": { - "description": "Role of the user successfully deleted.\n\n" - }, - "400": { - "description": "The request was invalid or the payload malformed.\n\n", + "200": { + "description": "A possibly empty list of Deployment Deltas.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" + "items": { + "$ref": "#/components/schemas/DeltaResponse" + }, + "type": "array" } } } - }, - "404": { - "description": "Object does not exist.\n\n" } } }, - "patch": { + "post": { "tags": [ "public", - "UserRole" + "Delta" ], - "summary": "Update the role of a User on an Organization", - "operationId": "updateUserRoleInOrg", + "summary": "Create a new Delta", "parameters": [ { - "name": "orgId", - "in": "path", - "description": "The Organization ID.\n\n", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/orgIdPathParam" }, { - "name": "userId", - "in": "path", - "description": "The User ID\n\n", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/appIdPathParam" } ], "requestBody": { - "description": "The new user the role\n\n", + "description": "A Deployment Delta to create.\n\nThe Deployment Delta will be added with the provided content of `modules` and the 'env_id' and 'name' properties of the 'metadata' property.\n\nNOTE: If the `id` property is specified, it will be ignored. A new ID will be generated and returned in the response.", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RoleRequest" + "$ref": "#/components/schemas/DeltaRequest" + }, + "example": { + "metadata": { + "env_id": "feature-test", + "name": "Updates for ticket # 2581" + }, + "modules": { + "updates": { + "module-one": [ + { + "op": "add", + "path": "/spec/containers/simple-service/variables/REDIS_URL", + "value": "redis://${modules.redis-cache.service.name}" + } + ] + } + } } } } }, "responses": { "200": { - "description": "The information on the user.\n\n", + "description": "The requested Deployment Delta.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserRoleResponse" + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/DeltaResponse" + } + ] } } } }, "400": { - "description": "The request was invalid or the payload malformed.\n\n", + "description": "The request was invalid.\n\n", "content": { "application/json": { "schema": { @@ -2828,43 +2949,29 @@ } } } - }, - "404": { - "description": "Object does not exist.\n\n" } } } }, - "/orgs/{orgId}/apps/{appId}/envs/{envId}/rules": { + "/orgs/{orgId}/apps/{appId}/deltas/{deltaId}": { "get": { "tags": [ "public", - "AutomationRule" + "Delta" ], - "summary": "List all Automation Rules in an Environment.", + "summary": "Fetch an existing Delta", + "operationId": "getDelta", "parameters": [ { - "name": "orgId", - "in": "path", - "description": "The Organization ID.\n\n", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/orgIdPathParam" }, { - "name": "appId", - "in": "path", - "description": "The Application ID.\n\n", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/appIdPathParam" }, { - "name": "envId", + "name": "deltaId", "in": "path", - "description": "The Environment ID.\n\n", + "description": "ID of the Delta to fetch.\n\n", "required": true, "schema": { "type": "string" @@ -2873,73 +2980,44 @@ ], "responses": { "200": { - "description": "A possibly empty array of Automation Rules\n\n", + "description": "The requested Deployment Delta.", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/AutomationRuleResponse" - }, - "type": "array" - }, - "example": [ - { - "active": true, - "artefacts_filter": [ - "http://registry.org/sample-service" - ], - "created_at": "2021-07-22T14:53:27Z", - "created_by": "0dbbdc88-b125-47f1-9a96-6c4c9d6ddc70", - "exclude_artefacts_filter": false, - "exclude_images_filter": false, - "id": "923486d012f20324", - "images_filter": [ - "sample-service" - ], - "match": "^pr-[0-9]+-.*$", - "match_ref": "^refs/heads/pr-[0-9]+-.*$", - "type": "update", - "update_to": "branch" - } - ] + "$ref": "#/components/schemas/DeltaResponse" + } } } }, - "500": { - "description": "Internal Server error.\n\n" + "404": { + "description": "No Deployment Delta with ID `deltaId` found in Application.\n\n", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } } } }, - "post": { + "patch": { "tags": [ "public", - "AutomationRule" + "Delta" ], - "summary": "Create a new Automation Rule for an Environment.", - "description": "Items marked as deprecated are still supported (however not recommended) for use and are incompatible with properties of the latest api version. In particular an error is raised if `images_filter` (deprecated) and `artefacts_filter` are used in the same payload. The same is true for `exclude_images_filter` (deprecated) and `exclude_artefacts_filter`. `match` and `update_to` are still supported but will trigger an error if combined with `match_ref`.", + "summary": "Update an existing Delta", "parameters": [ { - "name": "orgId", - "in": "path", - "description": "The Organization ID.\n\n", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/orgIdPathParam" }, { - "name": "appId", - "in": "path", - "description": "The Application ID.\n\n", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/appIdPathParam" }, { - "name": "envId", + "name": "deltaId", "in": "path", - "description": "The Environment ID.\n\n", + "description": "ID of the Delta to update.\n\n", "required": true, "schema": { "type": "string" @@ -2947,170 +3025,148 @@ } ], "requestBody": { - "description": "The definition of the Automation Rule.\n\n", + "description": "An array of Deltas.\n\nThe Deltas in the request are combined, meaning the current Delta is updated in turn by each Delta in the request. Once all Deltas have been combined, the resulting Delta is simplified.\n\n* All Modules in the `modules.add` property are replaced with the new Delta's values. If the value of a Module is `null`, and the ID is in the `modules.remove` list, it is removed from the `modules.remove` list.\n\n* All IDs listed in `modules.remove` are combined. Any ID in `modules.remove` and also in `modules.add` are removed from `modules.add`\n\n* The lists of JSON Patches in `modules.update` are concatenated or created in `modules.updates`.\n\nSimplification involves:\n\n* Applying any entries in `modules.updates` that have matching IDs in `modules.add` to the `modules.add` entry and removing the `modules.update` entry.\n\n* Reducing the number of JSON Patches in each `modules.update` entry to the smallest set that has the same effect.\n\n**Extension to JSON Patch**\n\nIf a JSON Patch entry needs to be removed, without side effects, the `value` of the `remove` action can be set to `{\"scope\": \"delta\"}. This will result in the remove action being used during simplification but be discarded before the Delta is finalized.\n\nIf the user making the request is not the user who created the Delta and they are not already on the contributors list, they will be added to the contributors list.\n\n_NOTE: If the `id` or `metadata` properties are specified, they will be ignored._", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AutomationRuleRequest" + "items": { + "$ref": "#/components/schemas/DeltaRequest" + }, + "type": "array" }, - "example": { - "active": true, - "artefacts_filter": [ - "http://registry.org/sample-service" - ], - "exclude_artefacts_filter": false, - "match_ref": "^refs/heads/pr-[0-9]+-.*$", - "type": "update" - } + "example": [ + { + "modules": { + "updates": { + "module-one": [ + { + "op": "add", + "path": "/spec/containers/simple-service/variables/REDIS_URL", + "value": "redis://${modules.redis-cache.service.name}" + } + ] + } + } + } + ] } } }, "responses": { - "201": { - "description": "The AutomationRule\n\n", + "200": { + "description": "The requested Deployment Delta.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AutomationRuleResponse" + "$ref": "#/components/schemas/DeltaResponse" } } } }, "400": { - "description": "The input was not a valid Automation Rule.\n\n", + "description": "The request was invalid.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorInfoResponse" + "$ref": "#/components/schemas/HumanitecErrorResponse" } } } }, - "422": { - "description": "The request body could not be processed.\n\n" + "404": { + "description": "No Deployment Delta with ID `deltaId` found in Application.\n\n", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } } } - } - }, - "/orgs/{orgId}/apps/{appId}/envs/{envId}/rules/{ruleId}": { - "get": { + }, + "put": { "tags": [ "public", - "AutomationRule" + "Delta" ], - "summary": "Get a specific Automation Rule for an Environment.", + "summary": "Update an existing Delta", + "operationId": "putDelta", "parameters": [ { - "name": "orgId", - "in": "path", - "description": "The Organization ID.\n\n", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "appId", - "in": "path", - "description": "The Application ID.\n\n", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/orgIdPathParam" }, { - "name": "envId", - "in": "path", - "description": "The Environment ID.\n\n", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/appIdPathParam" }, { - "name": "ruleId", + "name": "deltaId", "in": "path", - "description": "The Automation Rule ID.\n\n", + "description": "ID of the Delta to update.\n\n", "required": true, "schema": { "type": "string" } } ], + "requestBody": { + "description": "An array of Deltas.\n\nThe Deltas in the request are combined, meaning the current Delta is updated in turn by each Delta in the request. Once all Deltas have been combined, the resulting Delta is simplified.\n\n* All Modules in the `modules.add` property are replaced with the new Delta's values. If the value of a Module is `null`, and the ID is in the `modules.remove` list, it is removed from the `modules.remove` list.\n\n* All IDs listed in `modules.remove` are combined. Any ID in `modules.remove` and also in `modules.add` are removed from `modules.add`\n\n* The lists of JSON Patches in `modules.update` are concatenated or created in `modules.updates`.\n\nSimplification involves:\n\n* Applying any entries in `modules.updates` that have matching IDs in `modules.add` to the `modules.add` entry and removing the `modules.update` entry.\n\n* Reducing the number of JSON Patches in each `modules.update` entry to the smallest set that has the same effect.\n\n**Extension to JSON Patch**\n\nIf a JSON Patch entry needs to be removed, without side effects, the `value` of the `remove` action can be set to `{\"scope\": \"delta\"}. This will result in the remove action being used during simplification but be discarded before the Delta is finalized.\n\nIf the user making the request is not the user who created the Delta and they are not already on the contributors list, they will be added to the contributors list.\n\n_NOTE: If the `id` or `metadata` properties are specified, they will be ignored._", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeltaRequest" + } + } + } + }, "responses": { - "200": { - "description": "The AutomationRule\n\n", + "204": { + "description": "The requested Deployment Delta.\n\n" + }, + "400": { + "description": "The request was invalid.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AutomationRuleResponse" - }, - "example": { - "active": true, - "artefacts_filter": [ - "http://registry.org/sample-service" - ], - "created_at": "2021-07-22T14:53:27Z", - "created_by": "0dbbdc88-b125-47f1-9a96-6c4c9d6ddc70", - "exclude_artefacts_filter": false, - "exclude_images_filter": false, - "id": "923486d012f20324", - "images_filter": [ - "sample-service" - ], - "match": "^pr-[0-9]+-.*$", - "match_ref": "^refs/heads/pr-[0-9]+-.*$", - "type": "update", - "update_to": "branch" + "$ref": "#/components/schemas/HumanitecErrorResponse" } } } }, "404": { - "description": "There is no automation rule with the supplied ID.\n\n" + "description": "No Deployment Delta with ID `deltaId` found in Application.\n\n", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } } } - }, + } + }, + "/orgs/{orgId}/apps/{appId}/deltas/{deltaId}/metadata/archived": { "put": { "tags": [ "public", - "AutomationRule" + "Delta" ], - "summary": "Update an existing Automation Rule for an Environment.", - "description": "Items marked as deprecated are still supported (however not recommended) for use and are incompatible with properties of the latest api version. In particular an error is raised if `images_filter` (deprecated) and `artefacts_filter` are used in the same payload. The same is true for `exclude_images_filter` (deprecated) and `exclude_artefacts_filter`. `match` and `update_to` are still supported but will trigger an error if combined with `match_ref`.", + "summary": "Mark a Delta as \"archived\"", + "description": "Archived Deltas are still accessible but can no longer be updated.", "parameters": [ { - "name": "orgId", - "in": "path", - "description": "The Organization ID.\n\n", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "appId", - "in": "path", - "description": "The Application ID.\n\n", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/orgIdPathParam" }, { - "name": "envId", - "in": "path", - "description": "The Environment ID.\n\n", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/appIdPathParam" }, { - "name": "ruleId", + "name": "deltaId", "in": "path", - "description": "The Automation Rule ID.\n\n", + "description": "ID of the Deployment Delta.\n\n", "required": true, "schema": { "type": "string" @@ -3118,115 +3174,114 @@ } ], "requestBody": { - "description": "The definition of the Automation Rule.\n\n", + "description": "Either `true` or `false`.\n\n", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AutomationRuleRequest" + "type": "boolean" }, - "example": { - "active": true, - "artefacts_filter": [ - "http://registry.org/sample-service" - ], - "exclude_artefacts_filter": false, - "match_ref": "^refs/heads/pr-[0-9]+-.*$", - "type": "update" - } + "example": true } } }, "responses": { - "200": { - "description": "The AutomationRule\n\n", + "204": { + "description": "Archived state successfully updated.\n\n" + }, + "400": { + "description": "The request was invalid.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AutomationRuleResponse" + "$ref": "#/components/schemas/HumanitecErrorResponse" } } } }, - "400": { - "description": "The input was not a valid Automation Rule.\n\n", + "404": { + "description": "No Deployment Delta with ID `deltaId` found in Application.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorInfoResponse" + "type": "string" } } } - }, - "404": { - "description": "There is no automation rule with the supplied ID.\n\n" - }, - "422": { - "description": "The request body could not be processed.\n\n" } } - }, - "delete": { + } + }, + "/orgs/{orgId}/apps/{appId}/deltas/{deltaId}/metadata/env_id": { + "put": { "tags": [ "public", - "AutomationRule" + "Delta" ], - "summary": "Delete Automation Rule from an Environment.", + "summary": "Change the Environment of a Delta", "parameters": [ { - "name": "orgId", - "in": "path", - "description": "The Organization ID.\n\n", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "appId", - "in": "path", - "description": "The Application ID.\n\n", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/orgIdPathParam" }, { - "name": "envId", - "in": "path", - "description": "The Environment ID.\n\n", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/appIdPathParam" }, { - "name": "ruleId", + "name": "deltaId", "in": "path", - "description": "The Automation Rule ID.\n\n", + "description": "ID of the Deployment Delta.\n\n", "required": true, "schema": { "type": "string" } } ], + "requestBody": { + "description": "The new Environment ID. (NOTE: The string must still be JSON encoded.)\n\n", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EnvironmentID" + }, + "example": "new-env" + } + } + }, "responses": { "204": { - "description": "The AutomationRule was deleted.\n\n" + "description": "Environment ID successfully updated.\n\n" + }, + "400": { + "description": "The request was invalid.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HumanitecErrorResponse" + } + } + } }, "404": { - "description": "There is no automation rule with the supplied ID.\n\n" + "description": "No Deployment Delta with ID `deltaId` found in Application.\n\n", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } } } } }, - "/orgs/{orgId}/apps/{appId}/deltas": { - "get": { + "/orgs/{orgId}/apps/{appId}/deltas/{deltaId}/metadata/name": { + "put": { "tags": [ "public", "Delta" ], - "summary": "List Deltas in an Application", + "summary": "Change the name of a Delta", "parameters": [ { "$ref": "#/components/parameters/orgIdPathParam" @@ -3235,45 +3290,62 @@ "$ref": "#/components/parameters/appIdPathParam" }, { - "name": "archived", - "in": "query", - "description": "If true, return archived Deltas.\n\n", - "schema": { - "type": "boolean" - } - }, - { - "name": "env", - "in": "query", - "description": "Only return Deltas associated with the specified Environment.\n\n", + "name": "deltaId", + "in": "path", + "description": "ID of the Deployment Delta.\n\n", + "required": true, "schema": { - "type": "string", - "pattern": "^[a-z0-9](?:-?[a-z0-9]+)+$" + "type": "string" } } ], + "requestBody": { + "description": "The new name.(NOTE: The string must still be JSON encoded.)\n\n", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "string" + }, + "example": "Update for ticket #s 2568 & 2572" + } + } + }, "responses": { - "200": { - "description": "A possibly empty list of Deployment Deltas.\n\n", + "204": { + "description": "Name successfully updated.\n\n" + }, + "400": { + "description": "The request was invalid.\n\n", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/DeltaResponse" - }, - "type": "array" + "$ref": "#/components/schemas/HumanitecErrorResponse" + } + } + } + }, + "404": { + "description": "No Deployment Delta with ID `deltaId` found in Application.\n\n", + "content": { + "application/json": { + "schema": { + "type": "string" } } } } } - }, - "post": { + } + }, + "/orgs/{orgId}/apps/{appId}/sets": { + "get": { "tags": [ "public", - "Delta" + "Set" ], - "summary": "Create a new Delta", + "operationId": "getSets", + "summary": "Get all Deployment Sets", "parameters": [ { "$ref": "#/components/parameters/orgIdPathParam" @@ -3282,58 +3354,26 @@ "$ref": "#/components/parameters/appIdPathParam" } ], - "requestBody": { - "description": "A Deployment Delta to create.\n\nThe Deployment Delta will be added with the provided content of `modules` and the 'env_id' and 'name' properties of the 'metadata' property.\n\nNOTE: If the `id` property is specified, it will be ignored. A new ID will be generated and returned in the response.", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeltaRequest" - }, - "example": { - "metadata": { - "env_id": "feature-test", - "name": "Updates for ticket # 2581" - }, - "modules": { - "updates": { - "module-one": [ - { - "op": "add", - "path": "/spec/containers/simple-service/variables/REDIS_URL", - "value": "redis://${modules.redis-cache.service.name}" - } - ] - } - } - } - } - } - }, "responses": { "200": { - "description": "The requested Deployment Delta.\n\n", + "description": "The Requested Deployment Set.\n\n", "content": { "application/json": { "schema": { - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/DeltaResponse" - } - ] + "items": { + "$ref": "#/components/schemas/SetResponse" + }, + "type": "array" } } } }, - "400": { - "description": "The request was invalid.\n\n", + "404": { + "description": "No Deployment Set with ID `setId` found in Application.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" + "type": "string" } } } @@ -3341,14 +3381,13 @@ } } }, - "/orgs/{orgId}/apps/{appId}/deltas/{deltaId}": { + "/orgs/{orgId}/apps/{appId}/sets/{setId}": { "get": { "tags": [ "public", - "Delta" + "Set" ], - "summary": "Fetch an existing Delta", - "operationId": "getDelta", + "summary": "Get a Deployment Set", "parameters": [ { "$ref": "#/components/parameters/orgIdPathParam" @@ -3357,28 +3396,43 @@ "$ref": "#/components/parameters/appIdPathParam" }, { - "name": "deltaId", + "name": "setId", "in": "path", - "description": "ID of the Delta to fetch.\n\n", + "description": "ID of the Deployment Set.\n\n", "required": true, "schema": { "type": "string" } + }, + { + "name": "diff", + "in": "query", + "description": "ID of the Deployment Set to compared against.", + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "The requested Deployment Delta.", + "description": "The Requested Deployment Set.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeltaResponse" + "oneOf": [ + { + "$ref": "#/components/schemas/SetResponse" + }, + { + "$ref": "#/components/schemas/PlainDeltaResponse" + } + ] } } } }, "404": { - "description": "No Deployment Delta with ID `deltaId` found in Application.\n\n", + "description": "No Deployment Set with ID `setId` found in Application.\n\n", "content": { "application/json": { "schema": { @@ -3389,12 +3443,12 @@ } } }, - "patch": { + "post": { "tags": [ "public", - "Delta" + "Set" ], - "summary": "Update an existing Delta", + "summary": "Apply a Deployment Delta to a Deployment Set", "parameters": [ { "$ref": "#/components/parameters/orgIdPathParam" @@ -3403,9 +3457,9 @@ "$ref": "#/components/parameters/appIdPathParam" }, { - "name": "deltaId", + "name": "setId", "in": "path", - "description": "ID of the Delta to update.\n\n", + "description": "ID of the Deployment Set.\n\n", "required": true, "schema": { "type": "string" @@ -3413,47 +3467,36 @@ } ], "requestBody": { - "description": "An array of Deltas.\n\nThe Deltas in the request are combined, meaning the current Delta is updated in turn by each Delta in the request. Once all Deltas have been combined, the resulting Delta is simplified.\n\n* All Modules in the `modules.add` property are replaced with the new Delta's values. If the value of a Module is `null`, and the ID is in the `modules.remove` list, it is removed from the `modules.remove` list.\n\n* All IDs listed in `modules.remove` are combined. Any ID in `modules.remove` and also in `modules.add` are removed from `modules.add`\n\n* The lists of JSON Patches in `modules.update` are concatenated or created in `modules.updates`.\n\nSimplification involves:\n\n* Applying any entries in `modules.updates` that have matching IDs in `modules.add` to the `modules.add` entry and removing the `modules.update` entry.\n\n* Reducing the number of JSON Patches in each `modules.update` entry to the smallest set that has the same effect.\n\n**Extension to JSON Patch**\n\nIf a JSON Patch entry needs to be removed, without side effects, the `value` of the `remove` action can be set to `{\"scope\": \"delta\"}. This will result in the remove action being used during simplification but be discarded before the Delta is finalized.\n\nIf the user making the request is not the user who created the Delta and they are not already on the contributors list, they will be added to the contributors list.\n\n_NOTE: If the `id` or `metadata` properties are specified, they will be ignored._", + "description": "The Delta to apply to the Set.\n\nNOTE: The `id` parameter is ignored if provided. The request body should be the full Delta.", "required": true, "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/DeltaRequest" - }, - "type": "array" + "$ref": "#/components/schemas/DeltaRequest" }, - "example": [ - { - "modules": { - "updates": { - "module-one": [ - { - "op": "add", - "path": "/spec/containers/simple-service/variables/REDIS_URL", - "value": "redis://${modules.redis-cache.service.name}" - } - ] - } - } + "example": { + "modules": { + "remove": [ + "module-one" + ] } - ] + } } } }, "responses": { "200": { - "description": "The requested Deployment Delta.\n\n", + "description": "A Deployment Delta which if applied to the Set with ID `sourceSetId` gives the Set with ID `setId`.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeltaResponse" + "type": "string" } } } }, "400": { - "description": "The request was invalid.\n\n", + "description": "Deployment Delta is incompatible with the Deployment Set specified by `setId`.\n\n", "content": { "application/json": { "schema": { @@ -3463,7 +3506,7 @@ } }, "404": { - "description": "No Deployment Delta with ID `deltaId` found in Application.\n\n", + "description": "No Deployment Set with ID `setId` found in Application.\n\n", "content": { "application/json": { "schema": { @@ -3473,14 +3516,15 @@ } } } - }, - "put": { + } + }, + "/orgs/{orgId}/apps/{appId}/sets/{setId}/diff/{sourceSetId}": { + "get": { "tags": [ "public", - "Delta" + "Set" ], - "summary": "Update an existing Delta", - "operationId": "putDelta", + "summary": "Get the difference between 2 Deployment Sets", "parameters": [ { "$ref": "#/components/parameters/orgIdPathParam" @@ -3489,42 +3533,37 @@ "$ref": "#/components/parameters/appIdPathParam" }, { - "name": "deltaId", + "name": "setId", "in": "path", - "description": "ID of the Delta to update.\n\n", + "description": "ID of the Deployment Set.\n\n", "required": true, "schema": { "type": "string" } - } - ], - "requestBody": { - "description": "An array of Deltas.\n\nThe Deltas in the request are combined, meaning the current Delta is updated in turn by each Delta in the request. Once all Deltas have been combined, the resulting Delta is simplified.\n\n* All Modules in the `modules.add` property are replaced with the new Delta's values. If the value of a Module is `null`, and the ID is in the `modules.remove` list, it is removed from the `modules.remove` list.\n\n* All IDs listed in `modules.remove` are combined. Any ID in `modules.remove` and also in `modules.add` are removed from `modules.add`\n\n* The lists of JSON Patches in `modules.update` are concatenated or created in `modules.updates`.\n\nSimplification involves:\n\n* Applying any entries in `modules.updates` that have matching IDs in `modules.add` to the `modules.add` entry and removing the `modules.update` entry.\n\n* Reducing the number of JSON Patches in each `modules.update` entry to the smallest set that has the same effect.\n\n**Extension to JSON Patch**\n\nIf a JSON Patch entry needs to be removed, without side effects, the `value` of the `remove` action can be set to `{\"scope\": \"delta\"}. This will result in the remove action being used during simplification but be discarded before the Delta is finalized.\n\nIf the user making the request is not the user who created the Delta and they are not already on the contributors list, they will be added to the contributors list.\n\n_NOTE: If the `id` or `metadata` properties are specified, they will be ignored._", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeltaRequest" - } + }, + { + "name": "sourceSetId", + "in": "path", + "description": "ID of the Deployment Set to diff against.\n\n", + "required": true, + "schema": { + "type": "string" } } - }, + ], "responses": { - "204": { - "description": "The requested Deployment Delta.\n\n" - }, - "400": { - "description": "The request was invalid.\n\n", + "200": { + "description": "A Deployment Delta which if applied to the Set with ID `sourceSetId` gives the Set with ID `setId`.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" + "$ref": "#/components/schemas/PlainDeltaResponse" } } } }, "404": { - "description": "No Deployment Delta with ID `deltaId` found in Application.\n\n", + "description": "No Deployment Set with ID `setId` or `sourceSetId` found in Application.\n\n", "content": { "application/json": { "schema": { @@ -3536,151 +3575,103 @@ } } }, - "/orgs/{orgId}/apps/{appId}/deltas/{deltaId}/metadata/archived": { - "put": { + "/orgs/{orgId}/apps/{appId}/jobs": { + "delete": { "tags": [ "public", - "Delta" + "Event" ], - "summary": "Mark a Delta as \"archived\"", - "description": "Archived Deltas are still accessible but can no longer be updated.", + "summary": "Deletes all Jobs for the Application", "parameters": [ { - "$ref": "#/components/parameters/orgIdPathParam" - }, - { - "$ref": "#/components/parameters/appIdPathParam" - }, - { - "name": "deltaId", + "name": "orgId", "in": "path", - "description": "ID of the Deployment Delta.\n\n", + "description": "The Organization ID.\n\n", "required": true, "schema": { "type": "string" } - } - ], - "requestBody": { - "description": "Either `true` or `false`.\n\n", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "boolean" - }, - "example": true + }, + { + "name": "appId", + "in": "path", + "description": "The Application ID.\n\n", + "required": true, + "schema": { + "type": "string" } } - }, + ], "responses": { "204": { - "description": "Archived state successfully updated.\n\n" - }, - "400": { - "description": "The request was invalid.\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" - } - } - } - }, - "404": { - "description": "No Deployment Delta with ID `deltaId` found in Application.\n\n", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - } + "description": "Deleted successfully.\n\n" } } } }, - "/orgs/{orgId}/apps/{appId}/deltas/{deltaId}/metadata/env_id": { - "put": { + "/orgs/{orgId}/apps/{appId}/webhooks": { + "get": { "tags": [ "public", - "Delta" + "Event" ], - "summary": "Change the Environment of a Delta", + "summary": "List Webhooks", "parameters": [ { - "$ref": "#/components/parameters/orgIdPathParam" - }, - { - "$ref": "#/components/parameters/appIdPathParam" + "name": "orgId", + "in": "path", + "description": "The Organization ID.\n\n", + "required": true, + "schema": { + "type": "string" + } }, { - "name": "deltaId", + "name": "appId", "in": "path", - "description": "ID of the Deployment Delta.\n\n", + "description": "The Application ID.\n\n", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "description": "The new Environment ID. (NOTE: The string must still be JSON encoded.)\n\n", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EnvironmentID" - }, - "example": "new-env" - } - } - }, "responses": { - "204": { - "description": "Environment ID successfully updated.\n\n" - }, - "400": { - "description": "The request was invalid.\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" - } - } - } - }, - "404": { - "description": "No Deployment Delta with ID `deltaId` found in Application.\n\n", + "200": { + "description": "A list of Webhooks.\n\n", "content": { "application/json": { "schema": { - "type": "string" + "items": { + "$ref": "#/components/schemas/WebhookResponse" + }, + "type": "array" } } } } } - } - }, - "/orgs/{orgId}/apps/{appId}/deltas/{deltaId}/metadata/name": { - "put": { + }, + "post": { "tags": [ "public", - "Delta" + "Event" ], - "summary": "Change the name of a Delta", + "summary": "Create a new Webhook", "parameters": [ { - "$ref": "#/components/parameters/orgIdPathParam" - }, - { - "$ref": "#/components/parameters/appIdPathParam" + "name": "orgId", + "in": "path", + "description": "The Organization ID.\n\n", + "required": true, + "schema": { + "type": "string" + } }, { - "name": "deltaId", + "name": "appId", "in": "path", - "description": "ID of the Deployment Delta.\n\n", + "description": "The Application ID.\n\n", "required": true, "schema": { "type": "string" @@ -3688,23 +3679,28 @@ } ], "requestBody": { - "description": "The new name.(NOTE: The string must still be JSON encoded.)\n\n", "required": true, "content": { "application/json": { "schema": { - "type": "string" - }, - "example": "Update for ticket #s 2568 & 2572" + "$ref": "#/components/schemas/WebhookRequest" + } } } }, "responses": { - "204": { - "description": "Name successfully updated.\n\n" + "201": { + "description": "A created webhook.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebhookResponse" + } + } + } }, "400": { - "description": "The request was invalid.\n\n", + "description": "Some of the values supplied are invalid.\n\n", "content": { "application/json": { "schema": { @@ -3713,12 +3709,12 @@ } } }, - "404": { - "description": "No Deployment Delta with ID `deltaId` found in Application.\n\n", + "409": { + "description": "The supplied `id` clashes with an existing Job.\n\n", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/HumanitecErrorResponse" } } } @@ -3726,128 +3722,145 @@ } } }, - "/orgs/{orgId}/apps/{appId}/sets": { + "/orgs/{orgId}/apps/{appId}/webhooks/{jobId}": { "get": { "tags": [ "public", - "Set" + "Event" ], - "operationId": "getSets", - "summary": "Get all Deployment Sets", + "summary": "Get a Webhook", "parameters": [ { - "$ref": "#/components/parameters/orgIdPathParam" + "name": "orgId", + "in": "path", + "description": "The Organization ID.\n\n", + "required": true, + "schema": { + "type": "string" + } }, { - "$ref": "#/components/parameters/appIdPathParam" + "name": "appId", + "in": "path", + "description": "The Application ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "jobId", + "in": "path", + "description": "The Webhook ID.\n\n", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "The Requested Deployment Set.\n\n", + "description": "The requested webhook.\n\n", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/SetResponse" - }, - "type": "array" + "$ref": "#/components/schemas/WebhookResponse" } } } }, "404": { - "description": "No Deployment Set with ID `setId` found in Application.\n\n", + "description": "The requested webhook not found.\n\n", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/HumanitecErrorResponse" } } } } } - } - }, - "/orgs/{orgId}/apps/{appId}/sets/{setId}": { - "get": { + }, + "delete": { "tags": [ "public", - "Set" + "Event" ], - "summary": "Get a Deployment Set", + "summary": "Delete a Webhook", "parameters": [ { - "$ref": "#/components/parameters/orgIdPathParam" - }, - { - "$ref": "#/components/parameters/appIdPathParam" + "name": "orgId", + "in": "path", + "description": "The Organization ID.\n\n", + "required": true, + "schema": { + "type": "string" + } }, { - "name": "setId", + "name": "appId", "in": "path", - "description": "ID of the Deployment Set.\n\n", + "description": "The Application ID.\n\n", "required": true, "schema": { "type": "string" } }, { - "name": "diff", - "in": "query", - "description": "ID of the Deployment Set to compared against.", + "name": "jobId", + "in": "path", + "description": "The Webhook ID.\n\n", + "required": true, "schema": { "type": "string" } } ], "responses": { - "200": { - "description": "The Requested Deployment Set.\n\n", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/SetResponse" - }, - { - "$ref": "#/components/schemas/PlainDeltaResponse" - } - ] - } - } - } + "204": { + "description": "Deleted successfully\n\n" }, "404": { - "description": "No Deployment Set with ID `setId` found in Application.\n\n", + "description": "The requested webhook not found.\n\n", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/HumanitecErrorResponse" } } } } } }, - "post": { + "patch": { "tags": [ "public", - "Set" + "Event" ], - "summary": "Apply a Deployment Delta to a Deployment Set", + "summary": "Update a Webhook", "parameters": [ { - "$ref": "#/components/parameters/orgIdPathParam" - }, - { - "$ref": "#/components/parameters/appIdPathParam" - }, - { - "name": "setId", + "name": "orgId", "in": "path", - "description": "ID of the Deployment Set.\n\n", + "description": "The Organization ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "appId", + "in": "path", + "description": "The Application ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "jobId", + "in": "path", + "description": "The Webhook ID.\n\n", "required": true, "schema": { "type": "string" @@ -3855,36 +3868,28 @@ } ], "requestBody": { - "description": "The Delta to apply to the Set.\n\nNOTE: The `id` parameter is ignored if provided. The request body should be the full Delta.", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeltaRequest" - }, - "example": { - "modules": { - "remove": [ - "module-one" - ] - } + "$ref": "#/components/schemas/WebhookRequest" } } } }, "responses": { "200": { - "description": "A Deployment Delta which if applied to the Set with ID `sourceSetId` gives the Set with ID `setId`.\n\n", + "description": "Updated successfully, return the webhook\n\n", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/WebhookUpdateResponse" } } } }, "400": { - "description": "Deployment Delta is incompatible with the Deployment Set specified by `setId`.\n\n", + "description": "Bad request\n\n", "content": { "application/json": { "schema": { @@ -3894,11 +3899,11 @@ } }, "404": { - "description": "No Deployment Set with ID `setId` found in Application.\n\n", + "description": "The requested webhook not found.\n\n", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/HumanitecErrorResponse" } } } @@ -3906,33 +3911,18 @@ } } }, - "/orgs/{orgId}/apps/{appId}/sets/{setId}/diff/{sourceSetId}": { + "/orgs/{orgId}/events": { "get": { "tags": [ "public", - "Set" + "Event" ], - "summary": "Get the difference between 2 Deployment Sets", + "summary": "List Events", "parameters": [ { - "$ref": "#/components/parameters/orgIdPathParam" - }, - { - "$ref": "#/components/parameters/appIdPathParam" - }, - { - "name": "setId", - "in": "path", - "description": "ID of the Deployment Set.\n\n", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "sourceSetId", + "name": "orgId", "in": "path", - "description": "ID of the Deployment Set to diff against.\n\n", + "description": "The Organization ID.\n\n", "required": true, "schema": { "type": "string" @@ -3941,21 +3931,14 @@ ], "responses": { "200": { - "description": "A Deployment Delta which if applied to the Set with ID `sourceSetId` gives the Set with ID `setId`.\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PlainDeltaResponse" - } - } - } - }, - "404": { - "description": "No Deployment Set with ID `setId` or `sourceSetId` found in Application.\n\n", + "description": "A list of Events.\n\n", "content": { "application/json": { "schema": { - "type": "string" + "items": { + "$ref": "#/components/schemas/EventResponse" + }, + "type": "array" } } } @@ -3963,183 +3946,166 @@ } } }, - "/orgs/{orgId}/apps/{appId}/jobs": { - "delete": { + "/orgs/{orgId}/keys": { + "post": { "tags": [ "public", - "Event" + "PublicKeys" ], - "summary": "Deletes all Jobs for the Application", + "operationId": "createPublicKey", + "summary": "Associate a new RSA public key to an organization.", "parameters": [ { "name": "orgId", "in": "path", - "description": "The Organization ID.\n\n", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "appId", - "in": "path", - "description": "The Application ID.\n\n", + "description": "The organization ID.", "required": true, "schema": { "type": "string" } } ], + "requestBody": { + "description": "A pcks8 RSA public key PEM encoded (as the ones produced by openssl), whose module length is greater or equal than 4096 bits. It should be provided as a single line. This might be accomplished through the usage of `awk` bash tool: `awk -v ORS='\\n' '1' public_key.pem`", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "string" + }, + "example": "-----BEGIN PUBLIC KEY-----\\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAo22jj/h+WPhL5M8RUyqC\\nEqRK3FOYD6KuDTyUHZL2QUX/q35bT1aGIOtu+22oM/8hTZ/6+BTknvF+Z+e7At8E\\n/I6/qNZilJFH/HqNHYflykceILVCFQM6v0ar6CSPh88DjwQPGLrh+UYp0NKBF6D5\\n2LEVQpxsM/0qV4fOZngRVI9UeKiYehk8aXJi20nI5Cj9GnV7BuEo7sKq7NewTOMN\\nwHqSnCtMV+E7SIgyy4+aKAFHOR0Y4FgJN14bAjE2GX/VUmAYBNtPgGwkCNDbA9v1\\nJJnFmdKflp8foqeWwC9UcUDLqjZzMT2a16pnL89iHV4fJ4vI6h26Jf2wUJbb7xE3\\nxJNhCR9Qf2IHx8TTVetIRl5I/ZUPkRrq5iskOIWV4+I+NzS+gbnCUv6sCO3cnZaa\\noZ4Wk5V+5qfctANeTn0TEAabYAJ/zFgYcs2IwYNqcN5eTss99zGNgtDL3oJr/A6g\\neGBgzad3p80qPMb1le64cHAAFZaerI2kcdnNpWGLXJ/J7IKF9uNfsrvi7Zdv8AXg\\nVAyqBARfzSkgnUKN6iWkWxAAzylKnQ3Etw81huaLwDG/6Lqd8I5OePMwHEZkollD\\nEBD16L/iyV9veru2zLVXkX/nL64YtZERLOWI5NUMaSurAR4N3ptFAsDRcO5Z4+Dq\\nO3pqszSh1aCyJvyl6cjQLT8CAwEAAQ==\\n-----END PUBLIC KEY-----\\n" + } + } + }, "responses": { - "204": { - "description": "Deleted successfully.\n\n" + "200": { + "description": "Public Key added successfully.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublicKey" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400BadRequest" + }, + "403": { + "$ref": "#/components/responses/403Forbidden" + }, + "409": { + "$ref": "#/components/responses/409Conflict" } } - } - }, - "/orgs/{orgId}/apps/{appId}/webhooks": { + }, "get": { "tags": [ "public", - "Event" + "PublicKeys" ], - "summary": "List Webhooks", + "operationId": "listPublicKeys", + "summary": "List all public keys associated to an organization.", "parameters": [ { "name": "orgId", "in": "path", - "description": "The Organization ID.\n\n", + "description": "The organization ID.", "required": true, "schema": { "type": "string" } }, { - "name": "appId", - "in": "path", - "description": "The Application ID.\n\n", - "required": true, + "name": "fingerprint", + "in": "query", "schema": { "type": "string" - } + }, + "description": "The fingerprint (the hexadecimal representation of the sha256 hash of the DER representation of the key) of the requested key. If a value is provided, the result will contain a single key, if any." } ], "responses": { "200": { - "description": "A list of Webhooks.\n\n", + "description": "A possible empty list of public keys associated to an organization, sorted descending by creation date.", "content": { "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/WebhookResponse" + "$ref": "#/components/schemas/PublicKey" }, "type": "array" } } } + }, + "400": { + "$ref": "#/components/responses/400BadRequest" } } - }, - "post": { + } + }, + "/orgs/{orgId}/keys/{keyId}": { + "delete": { "tags": [ "public", - "Event" + "PublicKeys" ], - "summary": "Create a new Webhook", + "operationId": "deletePublicKey", + "summary": "Delete a public key associated to an organization.", "parameters": [ { "name": "orgId", "in": "path", - "description": "The Organization ID.\n\n", + "description": "The organization ID.", "required": true, "schema": { "type": "string" } }, { - "name": "appId", + "name": "keyId", "in": "path", - "description": "The Application ID.\n\n", + "description": "The public key ID.", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WebhookRequest" - } - } - } - }, "responses": { - "201": { - "description": "A created webhook.\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WebhookResponse" - } - } - } + "204": { + "description": "Public Key successfully removed." }, - "400": { - "description": "Some of the values supplied are invalid.\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" - } - } - } + "403": { + "$ref": "#/components/responses/403Forbidden" }, - "409": { - "description": "The supplied `id` clashes with an existing Job.\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" - } - } - } + "404": { + "$ref": "#/components/responses/404NotFound" } } - } - }, - "/orgs/{orgId}/apps/{appId}/webhooks/{jobId}": { + }, "get": { "tags": [ "public", - "Event" + "PublicKeys" ], - "summary": "Get a Webhook", + "operationId": "getPublicKey", + "summary": "Retrieve a single public key associated to an organization.", "parameters": [ { "name": "orgId", "in": "path", - "description": "The Organization ID.\n\n", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "appId", - "in": "path", - "description": "The Application ID.\n\n", + "description": "The organization ID.", "required": true, "schema": { "type": "string" } }, { - "name": "jobId", + "name": "keyId", "in": "path", - "description": "The Webhook ID.\n\n", + "description": "The public key ID.", "required": true, "schema": { "type": "string" @@ -4148,150 +4114,58 @@ ], "responses": { "200": { - "description": "The requested webhook.\n\n", + "description": "A public key associated to an organization.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookResponse" + "$ref": "#/components/schemas/PublicKey" } } } }, "404": { - "description": "The requested webhook not found.\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" - } - } - } - } - } - }, - "delete": { - "tags": [ - "public", - "Event" - ], - "summary": "Delete a Webhook", - "parameters": [ - { - "name": "orgId", - "in": "path", - "description": "The Organization ID.\n\n", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "appId", - "in": "path", - "description": "The Application ID.\n\n", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "jobId", - "in": "path", - "description": "The Webhook ID.\n\n", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Deleted successfully\n\n" - }, - "404": { - "description": "The requested webhook not found.\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" - } - } - } + "$ref": "#/components/responses/404NotFound" } } - }, - "patch": { + } + }, + "/orgs/{orgId}/humanitec-keys": { + "get": { "tags": [ "public", - "Event" + "HumanitecPublicKeys" ], - "summary": "Update a Webhook", + "operationId": "listHumanitecPublicKeys", + "summary": "List all the public keys Humanitec shares with an organization.", "parameters": [ { "name": "orgId", "in": "path", - "description": "The Organization ID.\n\n", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "appId", - "in": "path", - "description": "The Application ID.\n\n", + "description": "The organization ID.", "required": true, "schema": { "type": "string" } }, { - "name": "jobId", - "in": "path", - "description": "The Webhook ID.\n\n", - "required": true, + "name": "active", + "in": "query", "schema": { - "type": "string" - } + "type": "boolean" + }, + "description": "If set to true, the response includes only the active key, if set to false only non-active keys, otherwise both active and non-active keys." } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WebhookRequest" - } - } - } - }, "responses": { "200": { - "description": "Updated successfully, return the webhook\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WebhookUpdateResponse" - } - } - } - }, - "400": { - "description": "Bad request\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" - } - } - } - }, - "404": { - "description": "The requested webhook not found.\n\n", + "description": "A possible empty list of public keys which Humanitec shares with an organization, sorted by the active value and descending by creation date.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" + "items": { + "$ref": "#/components/schemas/HumanitecPublicKey" + }, + "type": "array" } } } @@ -4299,399 +4173,137 @@ } } }, - "/orgs/{orgId}/events": { + "/orgs": { "get": { "tags": [ "public", - "Event" - ], - "summary": "List Events", - "parameters": [ - { - "name": "orgId", - "in": "path", - "description": "The Organization ID.\n\n", - "required": true, - "schema": { - "type": "string" - } - } + "Organization" ], + "summary": "List active organizations the user has access to.", + "operationId": "listOrganizations", "responses": { "200": { - "description": "A list of Events.\n\n", + "description": "A list of available organizations (based on the current user access level).\n\n", "content": { "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/EventResponse" + "$ref": "#/components/schemas/OrganizationResponse" }, "type": "array" } } } + }, + "403": { + "$ref": "#/components/responses/403Forbidden" } } } }, - "/orgs/{orgId}/keys": { - "post": { + "/orgs/{orgId}": { + "get": { "tags": [ "public", - "PublicKeys" + "Organization" ], - "operationId": "createPublicKey", - "summary": "Associate a new RSA public key to an organization.", + "summary": "Get the specified Organization.", + "operationId": "getOrganization", "parameters": [ { "name": "orgId", "in": "path", - "description": "The organization ID.", + "description": "The Organization ID.\n\n", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "description": "A pcks8 RSA public key PEM encoded (as the ones produced by openssl), whose module length is greater or equal than 4096 bits. It should be provided as a single line. This might be accomplished through the usage of `awk` bash tool: `awk -v ORS='\\n' '1' public_key.pem`", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "string" - }, - "example": "-----BEGIN PUBLIC KEY-----\\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAo22jj/h+WPhL5M8RUyqC\\nEqRK3FOYD6KuDTyUHZL2QUX/q35bT1aGIOtu+22oM/8hTZ/6+BTknvF+Z+e7At8E\\n/I6/qNZilJFH/HqNHYflykceILVCFQM6v0ar6CSPh88DjwQPGLrh+UYp0NKBF6D5\\n2LEVQpxsM/0qV4fOZngRVI9UeKiYehk8aXJi20nI5Cj9GnV7BuEo7sKq7NewTOMN\\nwHqSnCtMV+E7SIgyy4+aKAFHOR0Y4FgJN14bAjE2GX/VUmAYBNtPgGwkCNDbA9v1\\nJJnFmdKflp8foqeWwC9UcUDLqjZzMT2a16pnL89iHV4fJ4vI6h26Jf2wUJbb7xE3\\nxJNhCR9Qf2IHx8TTVetIRl5I/ZUPkRrq5iskOIWV4+I+NzS+gbnCUv6sCO3cnZaa\\noZ4Wk5V+5qfctANeTn0TEAabYAJ/zFgYcs2IwYNqcN5eTss99zGNgtDL3oJr/A6g\\neGBgzad3p80qPMb1le64cHAAFZaerI2kcdnNpWGLXJ/J7IKF9uNfsrvi7Zdv8AXg\\nVAyqBARfzSkgnUKN6iWkWxAAzylKnQ3Etw81huaLwDG/6Lqd8I5OePMwHEZkollD\\nEBD16L/iyV9veru2zLVXkX/nL64YtZERLOWI5NUMaSurAR4N3ptFAsDRcO5Z4+Dq\\nO3pqszSh1aCyJvyl6cjQLT8CAwEAAQ==\\n-----END PUBLIC KEY-----\\n" - } - } - }, "responses": { "200": { - "description": "Public Key added successfully.", + "description": "Returns organization details.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PublicKey" + "$ref": "#/components/schemas/OrganizationResponse" } } } }, - "400": { - "$ref": "#/components/responses/400BadRequest" - }, "403": { "$ref": "#/components/responses/403Forbidden" - }, - "409": { - "$ref": "#/components/responses/409Conflict" } } - }, + } + }, + "/orgs/{orgId}/pipelines": { "get": { "tags": [ "public", - "PublicKeys" + "Pipelines" ], - "operationId": "listPublicKeys", - "summary": "List all public keys associated to an organization.", + "operationId": "listPipelinesInOrg", + "summary": "List all Pipelines within an Organization. This can be filtered by Application.", "parameters": [ { - "name": "orgId", - "in": "path", - "description": "The organization ID.", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/orgIdPathParam" }, { - "name": "fingerprint", - "in": "query", - "schema": { - "type": "string" - }, - "description": "The fingerprint (the hexadecimal representation of the sha256 hash of the DER representation of the key) of the requested key. If a value is provided, the result will contain a single key, if any." + "$ref": "#/components/parameters/byAppIdQueryParam" + }, + { + "$ref": "#/components/parameters/perPageQueryParam" + }, + { + "$ref": "#/components/parameters/pageTokenQueryParam" + }, + { + "$ref": "#/components/parameters/byTriggerTypeQueryParam" + }, + { + "$ref": "#/components/parameters/byMetadata" } ], "responses": { "200": { - "description": "A possible empty list of public keys associated to an organization, sorted descending by creation date.", + "description": "Successful list response. If the Link header is present, more data may be available.", + "headers": { + "Link": { + "schema": { + "type": "string" + }, + "description": "A list of request links, optionally including a \"next\" page link for pagination." + } + }, "content": { "application/json": { "schema": { + "type": "array", "items": { - "$ref": "#/components/schemas/PublicKey" - }, - "type": "array" + "$ref": "#/components/schemas/Pipeline" + } } } } }, "400": { "$ref": "#/components/responses/400BadRequest" + }, + "404": { + "$ref": "#/components/responses/404NotFound" } } } }, - "/orgs/{orgId}/keys/{keyId}": { - "delete": { + "/orgs/{orgId}/apps/{appId}/pipelines": { + "get": { "tags": [ "public", - "PublicKeys" + "Pipelines" ], - "operationId": "deletePublicKey", - "summary": "Delete a public key associated to an organization.", - "parameters": [ - { - "name": "orgId", - "in": "path", - "description": "The organization ID.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "keyId", - "in": "path", - "description": "The public key ID.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Public Key successfully removed." - }, - "403": { - "$ref": "#/components/responses/403Forbidden" - }, - "404": { - "$ref": "#/components/responses/404NotFound" - } - } - }, - "get": { - "tags": [ - "public", - "PublicKeys" - ], - "operationId": "getPublicKey", - "summary": "Retrieve a single public key associated to an organization.", - "parameters": [ - { - "name": "orgId", - "in": "path", - "description": "The organization ID.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "keyId", - "in": "path", - "description": "The public key ID.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "A public key associated to an organization.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PublicKey" - } - } - } - }, - "404": { - "$ref": "#/components/responses/404NotFound" - } - } - } - }, - "/orgs/{orgId}/humanitec-keys": { - "get": { - "tags": [ - "public", - "HumanitecPublicKeys" - ], - "operationId": "listHumanitecPublicKeys", - "summary": "List all the public keys Humanitec shares with an organization.", - "parameters": [ - { - "name": "orgId", - "in": "path", - "description": "The organization ID.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "active", - "in": "query", - "schema": { - "type": "boolean" - }, - "description": "If set to true, the response includes only the active key, if set to false only non-active keys, otherwise both active and non-active keys." - } - ], - "responses": { - "200": { - "description": "A possible empty list of public keys which Humanitec shares with an organization, sorted by the active value and descending by creation date.", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/HumanitecPublicKey" - }, - "type": "array" - } - } - } - } - } - } - }, - "/orgs": { - "get": { - "tags": [ - "public", - "Organization" - ], - "summary": "List active organizations the user has access to.", - "operationId": "listOrganizations", - "responses": { - "200": { - "description": "A list of available organizations (based on the current user access level).\n\n", - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/OrganizationResponse" - }, - "type": "array" - } - } - } - }, - "403": { - "$ref": "#/components/responses/403Forbidden" - } - } - } - }, - "/orgs/{orgId}": { - "get": { - "tags": [ - "public", - "Organization" - ], - "summary": "Get the specified Organization.", - "operationId": "getOrganization", - "parameters": [ - { - "name": "orgId", - "in": "path", - "description": "The Organization ID.\n\n", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Returns organization details.\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OrganizationResponse" - } - } - } - }, - "403": { - "$ref": "#/components/responses/403Forbidden" - } - } - } - }, - "/orgs/{orgId}/pipelines": { - "get": { - "tags": [ - "public", - "Pipelines" - ], - "operationId": "listPipelinesInOrg", - "summary": "List all Pipelines within an Organization. This can be filtered by Application.", - "parameters": [ - { - "$ref": "#/components/parameters/orgIdPathParam" - }, - { - "$ref": "#/components/parameters/byAppIdQueryParam" - }, - { - "$ref": "#/components/parameters/perPageQueryParam" - }, - { - "$ref": "#/components/parameters/pageTokenQueryParam" - }, - { - "$ref": "#/components/parameters/byTriggerTypeQueryParam" - }, - { - "$ref": "#/components/parameters/byMetadata" - } - ], - "responses": { - "200": { - "description": "Successful list response. If the Link header is present, more data may be available.", - "headers": { - "Link": { - "schema": { - "type": "string" - }, - "description": "A list of request links, optionally including a \"next\" page link for pagination." - } - }, - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pipeline" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/400BadRequest" - }, - "404": { - "$ref": "#/components/responses/404NotFound" - } - } - } - }, - "/orgs/{orgId}/apps/{appId}/pipelines": { - "get": { - "tags": [ - "public", - "Pipelines" - ], - "operationId": "listPipelines", - "summary": "List Pipelines within an Application.", + "operationId": "listPipelines", + "summary": "List Pipelines within an Application.", "parameters": [ { "$ref": "#/components/parameters/orgIdPathParam" @@ -8616,7 +8228,360 @@ { "name": "orgId", "in": "path", - "description": "The Organization ID.\n\n", + "description": "The Organization ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "List of Secret Stores.\n\n", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/SecretStoreResponse" + }, + "type": "array" + } + } + } + } + } + }, + "post": { + "tags": [ + "public", + "SecretStore" + ], + "summary": "Create a Secret Store for the given organization.", + "parameters": [ + { + "name": "orgId", + "in": "path", + "description": "The Organization ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Secret Store data.\n\n", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSecretStorePayloadRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Secret Store successfully added.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SecretStoreResponse" + } + } + } + }, + "400": { + "description": "One or more request body parameters are either missing, invalid, or the requested payload is not provided or is malformed.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HumanitecErrorResponse" + } + } + } + }, + "401": { + "description": "Request unauthorised.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HumanitecErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HumanitecErrorResponse" + } + } + } + } + } + } + }, + "/orgs/{orgId}/secretstores/{storeId}": { + "get": { + "tags": [ + "public", + "SecretStore" + ], + "summary": "Get the Secret Store.", + "parameters": [ + { + "name": "orgId", + "in": "path", + "description": "The Organization ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "storeId", + "in": "path", + "description": "The Secret Store ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Returns Secret Stores.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SecretStoreResponse" + } + } + } + }, + "404": { + "description": "Secret Store not found.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HumanitecErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "public", + "SecretStore" + ], + "summary": "Delete the Secret Store.", + "parameters": [ + { + "name": "orgId", + "in": "path", + "description": "The Organization ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "storeId", + "in": "path", + "description": "The Secret Store ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Secret Store successfully deleted.\n\n" + }, + "404": { + "description": "Secret Store not found.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HumanitecErrorResponse" + } + } + } + } + } + }, + "patch": { + "tags": [ + "public", + "SecretStore" + ], + "summary": "Update the Secret Store.", + "parameters": [ + { + "name": "orgId", + "in": "path", + "description": "The Organization ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "storeId", + "in": "path", + "description": "The Secret Store ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Secret Store data.\n\n", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateSecretStorePayloadRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Secret Store successfully updated.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SecretStoreResponse" + } + } + } + }, + "400": { + "description": "One or more request body parameters are either missing, invalid, or the requested payload is not provided or is malformed.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HumanitecErrorResponse" + } + } + } + }, + "404": { + "description": "Secret Store not found.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HumanitecErrorResponse" + } + } + } + } + } + } + }, + "/current-user": { + "get": { + "tags": [ + "public", + "UserProfile" + ], + "summary": "Gets the extended profile of the current user", + "operationId": "getCurrentUser", + "responses": { + "200": { + "description": "The extended user profile of the user.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserProfileExtendedResponse" + } + } + } + }, + "401": { + "description": "No token supplied.\n\n" + }, + "403": { + "description": "Token is not valid for a user.\n\n" + } + } + }, + "patch": { + "tags": [ + "public", + "UserProfile" + ], + "summary": "Updates the extended profile of the current user.", + "operationId": "updateCurrentUser", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserProfileExtendedRequest" + } + } + } + }, + "responses": { + "200": { + "description": "The extended user profile of the user.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserProfileExtendedResponse" + } + } + } + }, + "400": { + "description": "The request was invalid or the payload malformed.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HumanitecErrorResponse" + } + } + } + }, + "401": { + "description": "No token supplied.\n\n" + }, + "403": { + "description": "Token is not valid for a user.\n\n" + } + } + } + }, + "/orgs/{orgId}/apps/{appId}/users": { + "get": { + "tags": [ + "public", + "UserRole" + ], + "summary": "List Users with roles in an App", + "operationId": "listUserRolesInApp", + "parameters": [ + { + "name": "orgId", + "in": "path", + "description": "The Organization ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "appId", + "in": "path", + "description": "The Application ID.\n\n", "required": true, "schema": { "type": "string" @@ -8625,26 +8590,30 @@ ], "responses": { "200": { - "description": "List of Secret Stores.\n\n", + "description": "A list of Users and the roles they hold.\n\n", "content": { "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/SecretStoreResponse" + "$ref": "#/components/schemas/UserRoleResponse" }, "type": "array" } } } + }, + "404": { + "description": "Object does not exist.\n\n" } } }, "post": { "tags": [ "public", - "SecretStore" + "UserRole" ], - "summary": "Create a Secret Store for the given organization.", + "summary": "Adds a User to an Application with a Role", + "operationId": "createUserRoleInApp", "parameters": [ { "name": "orgId", @@ -8654,42 +8623,45 @@ "schema": { "type": "string" } + }, + { + "name": "appId", + "in": "path", + "description": "The Application ID.\n\n", + "required": true, + "schema": { + "type": "string" + } } ], "requestBody": { - "description": "Secret Store data.\n\n", + "description": "The user ID and the role\n\n", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateSecretStorePayloadRequest" + "$ref": "#/components/schemas/UserRoleRequest" + }, + "example": { + "id": "61048226-642c-438e-974f-ce5c013d94f8", + "role": "manager" } } } }, "responses": { - "201": { - "description": "Secret Store successfully added.\n\n", + "200": { + "description": "The user ID and associated role.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SecretStoreResponse" + "$ref": "#/components/schemas/UserRoleResponse" } } } }, "400": { - "description": "One or more request body parameters are either missing, invalid, or the requested payload is not provided or is malformed.\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" - } - } - } - }, - "401": { - "description": "Request unauthorised.\n\n", + "description": "The request was invalid or the payload malformed.\n\n", "content": { "application/json": { "schema": { @@ -8698,26 +8670,20 @@ } } }, - "409": { - "description": "Conflict.\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" - } - } - } + "404": { + "description": "The specified Application was not found.\n\n" } } } }, - "/orgs/{orgId}/secretstores/{storeId}": { + "/orgs/{orgId}/apps/{appId}/users/{userId}": { "get": { "tags": [ "public", - "SecretStore" + "UserRole" ], - "summary": "Get the Secret Store.", + "summary": "Get the role of a User on an Application", + "operationId": "getUserRoleInApp", "parameters": [ { "name": "orgId", @@ -8729,9 +8695,18 @@ } }, { - "name": "storeId", + "name": "appId", "in": "path", - "description": "The Secret Store ID.\n\n", + "description": "The Application ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "path", + "description": "The User ID\n\n", "required": true, "schema": { "type": "string" @@ -8740,17 +8715,17 @@ ], "responses": { "200": { - "description": "Returns Secret Stores.\n\n", + "description": "The information on the user.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SecretStoreResponse" + "$ref": "#/components/schemas/UserRoleResponse" } } } }, - "404": { - "description": "Secret Store not found.\n\n", + "400": { + "description": "The request was invalid or the payload malformed.\n\n", "content": { "application/json": { "schema": { @@ -8758,15 +8733,19 @@ } } } + }, + "404": { + "description": "Object does not exist.\n\n" } } }, "delete": { "tags": [ "public", - "SecretStore" + "UserRole" ], - "summary": "Delete the Secret Store.", + "summary": "Remove the role of a User on an Application", + "operationId": "deleteUserRoleInApp", "parameters": [ { "name": "orgId", @@ -8778,9 +8757,18 @@ } }, { - "name": "storeId", + "name": "appId", "in": "path", - "description": "The Secret Store ID.\n\n", + "description": "The Application ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "path", + "description": "The User ID\n\n", "required": true, "schema": { "type": "string" @@ -8789,10 +8777,10 @@ ], "responses": { "204": { - "description": "Secret Store successfully deleted.\n\n" + "description": "Role of the user successfully deleted.\n\n" }, - "404": { - "description": "Secret Store not found.\n\n", + "400": { + "description": "The request was invalid or the payload malformed.\n\n", "content": { "application/json": { "schema": { @@ -8800,15 +8788,19 @@ } } } + }, + "404": { + "description": "Object does not exist.\n\n" } } }, "patch": { "tags": [ "public", - "SecretStore" + "UserRole" ], - "summary": "Update the Secret Store.", + "summary": "Update the role of a User on an Application", + "operationId": "updateUserRoleInApp", "parameters": [ { "name": "orgId", @@ -8820,9 +8812,18 @@ } }, { - "name": "storeId", + "name": "appId", "in": "path", - "description": "The Secret Store ID.\n\n", + "description": "The Application ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userId", + "in": "path", + "description": "The User ID\n\n", "required": true, "schema": { "type": "string" @@ -8830,29 +8831,29 @@ } ], "requestBody": { - "description": "Secret Store data.\n\n", + "description": "The new user role\n\n", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateSecretStorePayloadRequest" + "$ref": "#/components/schemas/RoleRequest" } } } }, "responses": { "200": { - "description": "Secret Store successfully updated.\n\n", + "description": "The information on the user.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SecretStoreResponse" + "$ref": "#/components/schemas/UserRoleResponse" } } } }, "400": { - "description": "One or more request body parameters are either missing, invalid, or the requested payload is not provided or is malformed.\n\n", + "description": "The request was invalid or the payload malformed.\n\n", "content": { "application/json": { "schema": { @@ -8862,69 +8863,107 @@ } }, "404": { - "description": "Secret Store not found.\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" - } - } - } + "description": "Object does not exist.\n\n" } } } }, - "/current-user": { + "/orgs/{orgId}/env-types/{envType}/users": { "get": { "tags": [ "public", - "UserProfile" + "UserRole" + ], + "summary": "List Users with roles in an Environment Type", + "operationId": "listUserRolesInEnvType", + "parameters": [ + { + "name": "orgId", + "in": "path", + "description": "The Organization ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "envType", + "in": "path", + "description": "The Environment Type.\n\n", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Gets the extended profile of the current user", - "operationId": "getCurrentUser", "responses": { "200": { - "description": "The extended user profile of the user.\n\n", + "description": "A list of Users and the roles they hold.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserProfileExtendedResponse" + "items": { + "$ref": "#/components/schemas/UserRoleResponse" + }, + "type": "array" } } } }, - "401": { - "description": "No token supplied.\n\n" - }, - "403": { - "description": "Token is not valid for a user.\n\n" + "404": { + "description": "Object does not exist.\n\n" } } }, - "patch": { + "post": { "tags": [ "public", - "UserProfile" + "UserRole" + ], + "summary": "Adds a User to an Environment Type with a Role", + "operationId": "createUserRoleInEnvType", + "parameters": [ + { + "name": "orgId", + "in": "path", + "description": "The Organization ID.\n\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "envType", + "in": "path", + "description": "The Environment Type.\n\n", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Updates the extended profile of the current user.", - "operationId": "updateCurrentUser", "requestBody": { + "description": "The user ID and the role\n\n", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserProfileExtendedRequest" + "$ref": "#/components/schemas/UserRoleRequest" + }, + "example": { + "id": "61048226-642c-438e-974f-ce5c013d94f8", + "role": "manager" } } } }, "responses": { "200": { - "description": "The extended user profile of the user.\n\n", + "description": "The user ID and associated role.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserProfileExtendedResponse" + "$ref": "#/components/schemas/UserRoleResponse" } } } @@ -8939,23 +8978,20 @@ } } }, - "401": { - "description": "No token supplied.\n\n" - }, - "403": { - "description": "Token is not valid for a user.\n\n" + "404": { + "description": "The specified Application was not found.\n\n" } } } }, - "/orgs/{orgId}/apps/{appId}/users/{userId}": { + "/orgs/{orgId}/env-types/{envType}/users/{userId}": { "get": { "tags": [ "public", "UserRole" ], - "summary": "Get the role of a User on an Application", - "operationId": "getUserRoleInApp", + "summary": "Get the role of a User on an Environment Type", + "operationId": "getUserRoleInEnvType", "parameters": [ { "name": "orgId", @@ -8967,9 +9003,9 @@ } }, { - "name": "appId", + "name": "envType", "in": "path", - "description": "The Application ID.\n\n", + "description": "The Environment Type.\n\n", "required": true, "schema": { "type": "string" @@ -9015,9 +9051,9 @@ "tags": [ "public", "UserRole" - ], - "summary": "Remove the role of a User on an Application", - "operationId": "deleteUserRoleInApp", + ], + "summary": "Remove the role of a User on an Environment Type", + "operationId": "deleteUserRoleInEnvType", "parameters": [ { "name": "orgId", @@ -9029,9 +9065,9 @@ } }, { - "name": "appId", + "name": "envType", "in": "path", - "description": "The Application ID.\n\n", + "description": "The Environment Type.\n\n", "required": true, "schema": { "type": "string" @@ -9071,8 +9107,8 @@ "public", "UserRole" ], - "summary": "Update the role of a User on an Application", - "operationId": "updateUserRoleInApp", + "summary": "Update the role of a User on an Environment Type", + "operationId": "updateUserRoleInEnvType", "parameters": [ { "name": "orgId", @@ -9084,9 +9120,9 @@ } }, { - "name": "appId", + "name": "envType", "in": "path", - "description": "The Application ID.\n\n", + "description": "The Environment Type.\n\n", "required": true, "schema": { "type": "string" @@ -9140,14 +9176,14 @@ } } }, - "/orgs/{orgId}/env-types/{envType}/users": { + "/orgs/{orgId}/invitations": { "get": { "tags": [ "public", - "UserRole" + "UserInvite" ], - "summary": "List Users with roles in an Environment Type", - "operationId": "listUserRolesInEnvType", + "summary": "List the invites issued for the organization.", + "operationId": "listInvitesInOrg", "parameters": [ { "name": "orgId", @@ -9157,33 +9193,21 @@ "schema": { "type": "string" } - }, - { - "name": "envType", - "in": "path", - "description": "The Environment Type.\n\n", - "required": true, - "schema": { - "type": "string" - } } ], "responses": { "200": { - "description": "A list of Users and the roles they hold.\n\n", + "description": "The list of the invites issued for the organization.\n\n", "content": { "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/UserRoleResponse" + "$ref": "#/components/schemas/UserInviteResponse" }, "type": "array" } } } - }, - "404": { - "description": "Object does not exist.\n\n" } } }, @@ -9192,8 +9216,8 @@ "public", "UserRole" ], - "summary": "Adds a User to an Environment Type with a Role", - "operationId": "createUserRoleInEnvType", + "summary": "Invites a user to an Organization with a specified role.", + "operationId": "createInviteInOrg", "parameters": [ { "name": "orgId", @@ -9203,27 +9227,18 @@ "schema": { "type": "string" } - }, - { - "name": "envType", - "in": "path", - "description": "The Environment Type.\n\n", - "required": true, - "schema": { - "type": "string" - } } ], "requestBody": { - "description": "The user ID and the role\n\n", + "description": "The email and the desired role\n\n", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserRoleRequest" + "$ref": "#/components/schemas/UserInviteRequestRequest" }, "example": { - "id": "61048226-642c-438e-974f-ce5c013d94f8", + "email": "jane.gonzales@example.com", "role": "manager" } } @@ -9231,11 +9246,14 @@ }, "responses": { "200": { - "description": "The user ID and associated role.\n\n", + "description": "An temporary profile for the invited user.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserRoleResponse" + "items": { + "$ref": "#/components/schemas/UserRoleResponse" + }, + "type": "array" } } } @@ -9251,19 +9269,19 @@ } }, "404": { - "description": "The specified Application was not found.\n\n" + "description": "Object does not exist.\n\n" } } } }, - "/orgs/{orgId}/env-types/{envType}/users/{userId}": { + "/orgs/{orgId}/users": { "get": { "tags": [ "public", "UserRole" ], - "summary": "Get the role of a User on an Environment Type", - "operationId": "getUserRoleInEnvType", + "summary": "List Users with roles in an Organization", + "operationId": "listUserRolesInOrg", "parameters": [ { "name": "orgId", @@ -9273,43 +9291,18 @@ "schema": { "type": "string" } - }, - { - "name": "envType", - "in": "path", - "description": "The Environment Type.\n\n", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "userId", - "in": "path", - "description": "The User ID\n\n", - "required": true, - "schema": { - "type": "string" - } } ], "responses": { "200": { - "description": "The information on the user.\n\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserRoleResponse" - } - } - } - }, - "400": { - "description": "The request was invalid or the payload malformed.\n\n", + "description": "A list of Users and the roles they hold.\n\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HumanitecErrorResponse" + "items": { + "$ref": "#/components/schemas/UserRoleResponse" + }, + "type": "array" } } } @@ -9319,13 +9312,13 @@ } } }, - "delete": { + "post": { "tags": [ "public", - "UserRole" + "UserProfile" ], - "summary": "Remove the role of a User on an Environment Type", - "operationId": "deleteUserRoleInEnvType", + "summary": "Creates a new service user.", + "operationId": "createServiceUserInOrg", "parameters": [ { "name": "orgId", @@ -9335,29 +9328,32 @@ "schema": { "type": "string" } - }, - { - "name": "envType", - "in": "path", - "description": "The Environment Type.\n\n", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "userId", - "in": "path", - "description": "The User ID\n\n", - "required": true, - "schema": { - "type": "string" - } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewServiceUserRequest" + }, + "example": { + "name": "CI Robot", + "role": "manager" + } + } + } + }, "responses": { - "204": { - "description": "Role of the user successfully deleted.\n\n" + "200": { + "description": "The extended user profile of the user.\n\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserProfileResponse" + } + } + } }, "400": { "description": "The request was invalid or the payload malformed.\n\n", @@ -9369,18 +9365,20 @@ } } }, - "404": { - "description": "Object does not exist.\n\n" + "403": { + "description": "Token is not valid for a user.\n\n" } } - }, - "patch": { + } + }, + "/orgs/{orgId}/users/{userId}": { + "get": { "tags": [ "public", "UserRole" ], - "summary": "Update the role of a User on an Environment Type", - "operationId": "updateUserRoleInEnvType", + "summary": "Get the role of a User on an Organization", + "operationId": "getUserRoleInOrg", "parameters": [ { "name": "orgId", @@ -9391,15 +9389,6 @@ "type": "string" } }, - { - "name": "envType", - "in": "path", - "description": "The Environment Type.\n\n", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "userId", "in": "path", @@ -9410,17 +9399,6 @@ } } ], - "requestBody": { - "description": "The new user role\n\n", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RoleRequest" - } - } - } - }, "responses": { "200": { "description": "The information on the user.\n\n", @@ -9446,16 +9424,14 @@ "description": "Object does not exist.\n\n" } } - } - }, - "/orgs/{orgId}/invitations": { - "get": { + }, + "delete": { "tags": [ "public", - "UserInvite" + "UserRole" ], - "summary": "List the invites issued for the organization.", - "operationId": "listInvitesInOrg", + "summary": "Remove the role of a User on an Organization", + "operationId": "deleteUserRoleInOrg", "parameters": [ { "name": "orgId", @@ -9465,31 +9441,43 @@ "schema": { "type": "string" } + }, + { + "name": "userId", + "in": "path", + "description": "The User ID\n\n", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { - "200": { - "description": "The list of the invites issued for the organization.\n\n", + "204": { + "description": "Role of the user successfully deleted.\n\n" + }, + "400": { + "description": "The request was invalid or the payload malformed.\n\n", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/UserInviteResponse" - }, - "type": "array" + "$ref": "#/components/schemas/HumanitecErrorResponse" } } } + }, + "404": { + "description": "Object does not exist.\n\n" } } }, - "post": { + "patch": { "tags": [ "public", "UserRole" ], - "summary": "Invites a user to an Organization with a specified role.", - "operationId": "createInviteInOrg", + "summary": "Update the role of a User on an Organization", + "operationId": "updateUserRoleInOrg", "parameters": [ { "name": "orgId", @@ -9499,33 +9487,35 @@ "schema": { "type": "string" } + }, + { + "name": "userId", + "in": "path", + "description": "The User ID\n\n", + "required": true, + "schema": { + "type": "string" + } } ], "requestBody": { - "description": "The email and the desired role\n\n", + "description": "The new user the role\n\n", "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserInviteRequestRequest" - }, - "example": { - "email": "jane.gonzales@example.com", - "role": "manager" + "$ref": "#/components/schemas/RoleRequest" } } } }, "responses": { "200": { - "description": "An temporary profile for the invited user.\n\n", + "description": "The information on the user.\n\n", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/UserRoleResponse" - }, - "type": "array" + "$ref": "#/components/schemas/UserRoleResponse" } } }