diff --git a/public.openapi.json b/public.openapi.json index d53f6fa..f3fb0ae 100644 --- a/public.openapi.json +++ b/public.openapi.json @@ -86,13 +86,7 @@ }, "parameters": [ { - "name": "X-Rh-Insights-Request-Id", - "description": "Request id for distributed tracing.", - "required": false, - "schema": { - "type": "string" - }, - "in": "header" + "$ref": "#/components/parameters/XRhInsightsRequestIdHeader" } ], "post": { @@ -136,13 +130,7 @@ "summary": "Domain registration token", "parameters": [ { - "name": "X-Rh-Insights-Request-Id", - "description": "Request id", - "required": true, - "schema": { - "type": "string" - }, - "in": "header" + "$ref": "#/components/parameters/XRhInsightsRequestIdHeader" } ], "post": { @@ -234,27 +222,10 @@ }, "parameters": [ { - "name": "X-Rh-Insights-Request-Id", - "description": "Request id for distributed tracing.", - "required": false, - "schema": { - "type": "string" - }, - "in": "header" + "$ref": "#/components/parameters/XRhInsightsRequestIdHeader" }, { - "name": "uuid", - "description": "The uuid that identify the domain.", - "required": true, - "schema": { - "$ref": "#/components/schemas/DomainId" - }, - "examples": { - "a random uuid generated by 'uuid' command": { - "value": "\"2e8ce5a6-b370-11ed-9330-482ae3863d30\"" - } - }, - "in": "path" + "$ref": "#/components/parameters/DomainIdParam" } ] }, @@ -263,45 +234,16 @@ "summary": "Register domain information throw the ipa-hcc agent.", "parameters": [ { - "name": "X-Rh-Insights-Request-Id", - "description": "Request id", - "required": true, - "schema": { - "type": "string" - }, - "in": "header" + "$ref": "#/components/parameters/XRhInsightsRequestIdHeader" }, { - "name": "X-Rh-Idm-Registration-Token", - "description": "One-time password to authenticate domain registration with ipa-hcc command.", - "required": true, - "schema": { - "type": "string" - }, - "in": "header" + "$ref": "#/components/parameters/XRhIdmRegistrationTokenHeader" }, { - "name": "uuid", - "description": "uuid for the IPA domain.", - "required": true, - "schema": { - "$ref": "#/components/schemas/DomainId" - }, - "examples": { - "uuid": { - "value": "08363cd4-bea8-11ed-b83f-482ae3863d30" - } - }, - "in": "path" + "$ref": "#/components/parameters/XRhIdmVersionHeader" }, { - "name": "X-Rh-Idm-Version", - "description": "ipa-hcc agent version", - "required": true, - "schema": { - "type": "string" - }, - "in": "header" + "$ref": "#/components/parameters/DomainIdParam" } ], "put": { @@ -348,36 +290,13 @@ "summary": "Update domain information throw the ipa-hcc agent.", "parameters": [ { - "name": "X-Rh-Insights-Request-Id", - "description": "Request id", - "required": true, - "schema": { - "type": "string" - }, - "in": "header" + "$ref": "#/components/parameters/XRhInsightsRequestIdHeader" }, { - "name": "uuid", - "description": "uuid for the IPA domain.", - "required": true, - "schema": { - "$ref": "#/components/schemas/DomainId" - }, - "examples": { - "uuid": { - "value": "08363cd4-bea8-11ed-b83f-482ae3863d30" - } - }, - "in": "path" + "$ref": "#/components/parameters/XRhIdmVersionHeader" }, { - "name": "X-Rh-Idm-Version", - "description": "ipa-hcc agent version", - "required": true, - "schema": { - "type": "string" - }, - "in": "header" + "$ref": "#/components/parameters/DomainIdParam" } ], "put": { @@ -424,13 +343,7 @@ "summary": "Autoenroll host vm endpoint.", "parameters": [ { - "name": "X-Rh-Insights-Request-Id", - "description": "Unique request id for distributing tracing.", - "required": false, - "schema": { - "type": "string" - }, - "in": "header" + "$ref": "#/components/parameters/XRhInsightsRequestIdHeader" }, { "name": "inventory_id", @@ -491,6 +404,49 @@ } }, "components": { + "parameters": { + "DomainIdParam": { + "name": "uuid", + "description": "The uuid that identify the domain.", + "required": true, + "schema": { + "$ref": "#/components/schemas/DomainId" + }, + "examples": { + "a random uuid generated by 'uuid' command": { + "value": "\"2e8ce5a6-b370-11ed-9330-482ae3863d30\"" + } + }, + "in": "path" + }, + "XRhIdmRegistrationTokenHeader": { + "name": "X-Rh-Idm-Registration-Token", + "description": "One-time password to authenticate domain registration with ipa-hcc command.", + "required": true, + "schema": { + "type": "string" + }, + "in": "header" + }, + "XRhIdmVersionHeader": { + "name": "X-Rh-Idm-Version", + "description": "ipa-hcc agent version", + "required": true, + "schema": { + "type": "string" + }, + "in": "header" + }, + "XRhInsightsRequestIdHeader": { + "name": "X-Rh-Insights-Request-Id", + "description": "Request id for distributed tracing.", + "required": false, + "schema": { + "type": "string" + }, + "in": "header" + } + }, "responses": { "CreateDomainResponse": { "description": "Response when a domain has been created.", diff --git a/public.openapi.yaml b/public.openapi.yaml index 37311fc..e44f9ee 100644 --- a/public.openapi.yaml +++ b/public.openapi.yaml @@ -57,12 +57,7 @@ paths: tags: - resources parameters: - - name: X-Rh-Insights-Request-Id - description: Request id for distributed tracing. - required: false - schema: - type: string - in: header + - $ref: '#/components/parameters/XRhInsightsRequestIdHeader' post: description: Create a domain in the current organization. summary: Create a domain. @@ -89,12 +84,7 @@ paths: description: Request a domain registration token summary: Domain registration token parameters: - - name: X-Rh-Insights-Request-Id - description: Request id - required: true - schema: - type: string - in: header + - $ref: '#/components/parameters/XRhInsightsRequestIdHeader' post: description: Request a domain registration token summary: Domain registration token request @@ -151,52 +141,16 @@ paths: tags: - resources parameters: - - name: X-Rh-Insights-Request-Id - description: Request id for distributed tracing. - required: false - schema: - type: string - in: header - - name: uuid - description: The uuid that identify the domain. - required: true - schema: - $ref: '#/components/schemas/DomainId' - examples: - a random uuid generated by 'uuid' command: - value: '"2e8ce5a6-b370-11ed-9330-482ae3863d30"' - in: path + - $ref: '#/components/parameters/XRhInsightsRequestIdHeader' + - $ref: '#/components/parameters/DomainIdParam' /domains/{uuid}/register: description: First registration to update the IPA domain information. summary: Register domain information throw the ipa-hcc agent. parameters: - - name: X-Rh-Insights-Request-Id - description: Request id - required: true - schema: - type: string - in: header - - name: X-Rh-Idm-Registration-Token - description: One-time password to authenticate domain registration with ipa-hcc command. - required: true - schema: - type: string - in: header - - name: uuid - description: uuid for the IPA domain. - required: true - schema: - $ref: '#/components/schemas/DomainId' - examples: - uuid: - value: 08363cd4-bea8-11ed-b83f-482ae3863d30 - in: path - - name: X-Rh-Idm-Version - description: ipa-hcc agent version - required: true - schema: - type: string - in: header + - $ref: '#/components/parameters/XRhInsightsRequestIdHeader' + - $ref: '#/components/parameters/XRhIdmRegistrationTokenHeader' + - $ref: '#/components/parameters/XRhIdmVersionHeader' + - $ref: '#/components/parameters/DomainIdParam' put: description: |- Use the one time use token to update the initial information for @@ -227,27 +181,9 @@ paths: description: Update the rhel-idm domain information. summary: Update domain information throw the ipa-hcc agent. parameters: - - name: X-Rh-Insights-Request-Id - description: Request id - required: true - schema: - type: string - in: header - - name: uuid - description: uuid for the IPA domain. - required: true - schema: - $ref: '#/components/schemas/DomainId' - examples: - uuid: - value: 08363cd4-bea8-11ed-b83f-482ae3863d30 - in: path - - name: X-Rh-Idm-Version - description: ipa-hcc agent version - required: true - schema: - type: string - in: header + - $ref: '#/components/parameters/XRhInsightsRequestIdHeader' + - $ref: '#/components/parameters/XRhIdmVersionHeader' + - $ref: '#/components/parameters/DomainIdParam' put: description: Update the initial information for a rhel-idm domain. summary: Update a previously registered domain. @@ -276,12 +212,7 @@ paths: description: Endpoint used by host vm for auto-enrollment. summary: Autoenroll host vm endpoint. parameters: - - name: X-Rh-Insights-Request-Id - description: Unique request id for distributing tracing. - required: false - schema: - type: string - in: header + - $ref: '#/components/parameters/XRhInsightsRequestIdHeader' - name: inventory_id description: A Host-Based Inventory ID of the host. required: true @@ -318,6 +249,38 @@ paths: tags: - actions components: + parameters: + DomainIdParam: + name: uuid + description: The uuid that identify the domain. + required: true + schema: + $ref: '#/components/schemas/DomainId' + examples: + a random uuid generated by 'uuid' command: + value: '"2e8ce5a6-b370-11ed-9330-482ae3863d30"' + in: path + XRhIdmRegistrationTokenHeader: + name: X-Rh-Idm-Registration-Token + description: One-time password to authenticate domain registration with ipa-hcc command. + required: true + schema: + type: string + in: header + XRhIdmVersionHeader: + name: X-Rh-Idm-Version + description: ipa-hcc agent version + required: true + schema: + type: string + in: header + XRhInsightsRequestIdHeader: + name: X-Rh-Insights-Request-Id + description: Request id for distributed tracing. + required: false + schema: + type: string + in: header responses: CreateDomainResponse: description: Response when a domain has been created.