From 86edbc4c860c1be21f2fe5efe64a2aaa1dd4cb4f Mon Sep 17 00:00:00 2001 From: harish Date: Tue, 11 Feb 2025 09:39:17 -0500 Subject: [PATCH] DOC-2727 Inventory Public api documentation --- .../paths/cbiV1InventoryService.yaml | 72 +++++++++++++ .../cbiV1InventoryServiceIdProperty.yaml | 97 +++++++++++++++++ ...biV1InventoryServiceIdPropertyIdValue.yaml | 95 ++++++++++++++++ .../paths/cbiV1InventorySnapshot.yaml | 92 ++++++++++++++++ ...1InventorySnapshotIdServiceIdResource.yaml | 102 ++++++++++++++++++ ...torySnapshotIdServiceIdResourceDetail.yaml | 76 +++++++++++++ ...orySnapshotIdServiceIdResourceSummary.yaml | 68 ++++++++++++ .../get200cbiV1InventoryService.yaml | 24 +++++ ...get200cbiV1InventoryServiceIdProperty.yaml | 24 +++++ ...biV1InventoryServiceIdPropertyIdValue.yaml | 24 +++++ .../get200cbiV1InventorySnapshot.yaml | 24 +++++ ...1InventorySnapshotIdServiceIdResource.yaml | 24 +++++ ...torySnapshotIdServiceIdResourceDetail.yaml | 24 +++++ ...orySnapshotIdServiceIdResourceSummary.yaml | 24 +++++ .../beci/inventory/schemas/cloudProvider.yaml | 6 ++ .../beci/inventory/schemas/panelItem.yaml | 28 +++++ .../beci/inventory/schemas/panelProperty.yaml | 16 +++ .../schemas/propertyByServiceResponse.yaml | 25 +++++ .../schemas/propertyValuesResponse.yaml | 8 ++ .../inventory/schemas/providerDataItem.yaml | 11 ++ .../schemas/resourceDetailResponse.yaml | 61 +++++++++++ .../schemas/resourceReportResponse.yaml | 11 ++ .../inventory/schemas/resourceResponse.yaml | 63 +++++++++++ .../inventory/schemas/serviceResponse.yaml | 29 +++++ .../inventory/schemas/snapshotResponse.yaml | 14 +++ .../inventory/schemas/supportedOptions.yaml | 13 +++ api/spot.yaml | 34 ++++++ 27 files changed, 1089 insertions(+) create mode 100644 api/services/beci/inventory/paths/cbiV1InventoryService.yaml create mode 100644 api/services/beci/inventory/paths/cbiV1InventoryServiceIdProperty.yaml create mode 100644 api/services/beci/inventory/paths/cbiV1InventoryServiceIdPropertyIdValue.yaml create mode 100644 api/services/beci/inventory/paths/cbiV1InventorySnapshot.yaml create mode 100644 api/services/beci/inventory/paths/cbiV1InventorySnapshotIdServiceIdResource.yaml create mode 100644 api/services/beci/inventory/paths/cbiV1InventorySnapshotIdServiceIdResourceDetail.yaml create mode 100644 api/services/beci/inventory/paths/cbiV1InventorySnapshotIdServiceIdResourceSummary.yaml create mode 100644 api/services/beci/inventory/responses/get200cbiV1InventoryService.yaml create mode 100644 api/services/beci/inventory/responses/get200cbiV1InventoryServiceIdProperty.yaml create mode 100644 api/services/beci/inventory/responses/get200cbiV1InventoryServiceIdPropertyIdValue.yaml create mode 100644 api/services/beci/inventory/responses/get200cbiV1InventorySnapshot.yaml create mode 100644 api/services/beci/inventory/responses/get200cbiV1InventorySnapshotIdServiceIdResource.yaml create mode 100644 api/services/beci/inventory/responses/get200cbiV1InventorySnapshotIdServiceIdResourceDetail.yaml create mode 100644 api/services/beci/inventory/responses/get200cbiV1InventorySnapshotIdServiceIdResourceSummary.yaml create mode 100644 api/services/beci/inventory/schemas/cloudProvider.yaml create mode 100644 api/services/beci/inventory/schemas/panelItem.yaml create mode 100644 api/services/beci/inventory/schemas/panelProperty.yaml create mode 100644 api/services/beci/inventory/schemas/propertyByServiceResponse.yaml create mode 100644 api/services/beci/inventory/schemas/propertyValuesResponse.yaml create mode 100644 api/services/beci/inventory/schemas/providerDataItem.yaml create mode 100644 api/services/beci/inventory/schemas/resourceDetailResponse.yaml create mode 100644 api/services/beci/inventory/schemas/resourceReportResponse.yaml create mode 100644 api/services/beci/inventory/schemas/resourceResponse.yaml create mode 100644 api/services/beci/inventory/schemas/serviceResponse.yaml create mode 100644 api/services/beci/inventory/schemas/snapshotResponse.yaml create mode 100644 api/services/beci/inventory/schemas/supportedOptions.yaml diff --git a/api/services/beci/inventory/paths/cbiV1InventoryService.yaml b/api/services/beci/inventory/paths/cbiV1InventoryService.yaml new file mode 100644 index 00000000..5f63bb5b --- /dev/null +++ b/api/services/beci/inventory/paths/cbiV1InventoryService.yaml @@ -0,0 +1,72 @@ +get: + tags: + - Inventory Services + summary: Get Services + description: Returns a list of services. + operationId: getServicesCbiV1InventoryServiceGet + parameters: + - name: paginationSize + in: query + required: false + schema: + type: integer + description: Number of items to include in the response + description: Number of items to include in the response + - name: paginationKey + in: query + required: false + schema: + type: string + description: Key used to fetch a specific page of items + description: Key used to fetch a specific page of items + - name: accountId + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Spot account ID + description: Spot account ID + - name: subAccountIds + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + - type: 'null' + description: Subaccount IDs + description: Subaccount IDs + - name: providerName + in: query + required: false + schema: + type: array + items: + $ref: ../schemas/cloudProvider.yaml + description: Cloud Provider(s) + default: [] + description: Cloud Provider(s) + responses: + '200': + $ref: ../responses/get200cbiV1InventoryService.yaml + '400': + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml + description: Invalid request error response. Adjust the request before retrying. + '404': + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml + description: Not found error response. The requested resource does not exist. + '422': + description: Error response. + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml diff --git a/api/services/beci/inventory/paths/cbiV1InventoryServiceIdProperty.yaml b/api/services/beci/inventory/paths/cbiV1InventoryServiceIdProperty.yaml new file mode 100644 index 00000000..98e68d9f --- /dev/null +++ b/api/services/beci/inventory/paths/cbiV1InventoryServiceIdProperty.yaml @@ -0,0 +1,97 @@ +get: + tags: + - Inventory Services + summary: Get Service Properties + description: Returns a list of service properties. + operationId: getPropertiesByServiceCbiV1InventoryServiceServiceIdPropertyGet + parameters: + - name: serviceId + in: path + required: true + schema: + type: string + description: Service ID + description: Service ID + - name: paginationSize + in: query + required: false + schema: + type: integer + description: Number of items to include in the response + description: Number of items to include in the response + - name: paginationKey + in: query + required: false + schema: + type: string + description: Key used to fetch a specific page of items + description: Key used to fetch a specific page of items + - name: accountId + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Spot account ID + description: Spot account ID + - name: subAccountIds + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + - type: 'null' + description: Subaccount IDs + description: Subaccount IDs + - name: default + in: query + required: false + schema: + anyOf: + - type: boolean + - type: 'null' + description: None returns all the properties, True returns only the default properties, False returns only the non-default properties + description: None returns all the properties, True returns only the default properties, False returns only the non-default properties + - name: selectable + in: query + required: false + schema: + anyOf: + - type: boolean + - type: 'null' + description: None returns all the properties, True returns only the selectable properties, False returns only the non-selectable properties + description: None returns all the properties, True returns only the selectable properties, False returns only the non-selectable properties + - name: region + in: query + required: false + schema: + type: array + items: + type: string + description: List of region(s) + default: [] + description: List of region(s) + responses: + '200': + $ref: ../responses/get200cbiV1InventoryServiceIdProperty.yaml + '400': + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml + description: Invalid request error response. Adjust the request before retrying. + '404': + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml + description: Not found error response. The requested resource does not exist. + '422': + description: Error response. + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml diff --git a/api/services/beci/inventory/paths/cbiV1InventoryServiceIdPropertyIdValue.yaml b/api/services/beci/inventory/paths/cbiV1InventoryServiceIdPropertyIdValue.yaml new file mode 100644 index 00000000..4928a6f3 --- /dev/null +++ b/api/services/beci/inventory/paths/cbiV1InventoryServiceIdPropertyIdValue.yaml @@ -0,0 +1,95 @@ +get: + tags: + - Inventory Services + summary: Get Service property values + description: Returns a list of service property values. + operationId: getValuesByServiceCbiV1InventoryServiceServiceIdPropertyPropertyNameValueGet + parameters: + - name: serviceId + in: path + required: true + schema: + type: string + description: Service ID + description: Service ID + - name: propertyName + in: path + required: true + schema: + type: string + description: Property Name + description: Property Name + - name: search + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Search for items that contain the specified value (case insensitive). + description: Search for items that contain the specified value (case insensitive). + - name: paginationSize + in: query + required: false + schema: + type: integer + description: Number of items to include in the response + description: Number of items to include in the response + - name: paginationKey + in: query + required: false + schema: + type: string + description: Key used to fetch a specific page of items + description: Key used to fetch a specific page of items + - name: accountId + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Spot account ID + description: Spot account ID + - name: subAccountIds + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + - type: 'null' + description: Subaccount IDs + description: Subaccount IDs + - name: region + in: query + required: false + schema: + type: array + items: + type: string + description: List of region(s) + default: [] + description: List of region(s) + responses: + '200': + $ref: ../responses/get200cbiV1InventoryServiceIdPropertyIdValue.yaml + '400': + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml + description: Invalid request error response. Adjust the request before retrying. + '404': + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml + description: Not found error response. The requested resource does not exist. + '422': + description: Error response. + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml diff --git a/api/services/beci/inventory/paths/cbiV1InventorySnapshot.yaml b/api/services/beci/inventory/paths/cbiV1InventorySnapshot.yaml new file mode 100644 index 00000000..958cfd5a --- /dev/null +++ b/api/services/beci/inventory/paths/cbiV1InventorySnapshot.yaml @@ -0,0 +1,92 @@ +get: + tags: + - Inventory Snapshots + summary: Get Snapshots + description: Returns a list of snapshot id and date. + operationId: getSnapshotsCbiV1InventorySnapshotGet + parameters: + - name: paginationSize + in: query + required: false + schema: + type: integer + description: Number of items to include in the response + description: Number of items to include in the response + - name: paginationKey + in: query + required: false + schema: + type: string + description: Key used to fetch a specific page of items + description: Key used to fetch a specific page of items + - name: accountId + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Spot account ID + description: Spot account ID + - name: subAccountIds + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + - type: 'null' + description: Subaccount IDs + description: Subaccount IDs + - name: minSnapshotDate + in: query + required: false + schema: + anyOf: + - type: string + format: date-time + - type: 'null' + description: If specified, snapshot greater than this timestamp. + description: If specified, snapshot greater than this timestamp. + - name: maxSnapshotDate + in: query + required: false + schema: + anyOf: + - type: string + format: date-time + - type: 'null' + description: If specified, snapshot less than this timestamp. + description: If specified, snapshot less than this timestamp. + - name: providerName + in: query + required: false + schema: + type: array + items: + $ref: ../schemas/cloudProvider.yaml + description: Cloud Provider(s) + default: [] + description: Cloud Provider(s) + responses: + '200': + $ref: ../responses/get200cbiV1InventorySnapshot.yaml + '400': + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml + description: Invalid request error response. Adjust the request before retrying. + '404': + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml + description: Not found error response. The requested resource does not exist. + '422': + description: Error response. + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml diff --git a/api/services/beci/inventory/paths/cbiV1InventorySnapshotIdServiceIdResource.yaml b/api/services/beci/inventory/paths/cbiV1InventorySnapshotIdServiceIdResource.yaml new file mode 100644 index 00000000..e945979f --- /dev/null +++ b/api/services/beci/inventory/paths/cbiV1InventorySnapshotIdServiceIdResource.yaml @@ -0,0 +1,102 @@ +get: + tags: + - Inventory Resources + summary: Get Resources + description: Returns a list of resources processed in the given snapshot ID and service ID. + operationId: getResourcesByServiceCbiV1InventorySnapshotSnapshotIdServiceServiceIdResourceGet + parameters: + - name: snapshotId + in: path + required: true + schema: + type: string + format: date-time + description: Snapshot ID + description: Snapshot ID + - name: serviceId + in: path + required: true + schema: + type: string + description: Service ID + description: Service ID + - name: paginationSize + in: query + required: false + schema: + type: integer + description: Number of items to include in the response + description: Number of items to include in the response + - name: paginationKey + in: query + required: false + schema: + type: string + description: Key used to fetch a specific page of items + description: Key used to fetch a specific page of items + - name: accountId + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Spot account ID + description: Spot account ID + - name: subAccountIds + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + - type: 'null' + description: Subaccount IDs + description: Subaccount IDs + - name: select + in: query + required: false + schema: + type: array + items: + type: string + description: List of properties to return for each resource. + default: [] + description: List of properties to return for each resource. + - name: includeCommonProperties + in: query + required: false + schema: + type: boolean + description: Include the common properties in addition to any properties specified in select + default: true + description: Include the common properties in addition to any properties specified in select + - name: filter + in: query + required: false + schema: + type: string + description: Filter expression. + description: Filter expression. + responses: + '200': + $ref: ../responses/get200cbiV1InventorySnapshotIdServiceIdResource.yaml + '400': + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml + description: Invalid request error response. Adjust the request before retrying. + '404': + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml + description: Not found error response. The requested resource does not exist. + '422': + description: Error response. + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml diff --git a/api/services/beci/inventory/paths/cbiV1InventorySnapshotIdServiceIdResourceDetail.yaml b/api/services/beci/inventory/paths/cbiV1InventorySnapshotIdServiceIdResourceDetail.yaml new file mode 100644 index 00000000..426c0897 --- /dev/null +++ b/api/services/beci/inventory/paths/cbiV1InventorySnapshotIdServiceIdResourceDetail.yaml @@ -0,0 +1,76 @@ +get: + tags: + - Inventory Resources + summary: Get resource detail + description: Returns a detailed resource response for the provided Service ID. + operationId: getResourceCbiV1InventorySnapshotSnapshotIdServiceServiceIdResourceDetailGet + parameters: + - name: snapshotId + in: path + required: true + schema: + type: string + format: date-time + description: Snapshot ID + description: Snapshot ID + - name: serviceId + in: path + required: true + schema: + type: string + description: Service ID + description: Service ID + - name: accountId + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Spot account ID + description: Spot account ID + - name: subAccountId + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Subaccount ID + description: Subaccount ID + - name: resourceId + in: query + required: false + schema: + type: string + description: Resource ID. + description: Resource ID. + - name: includeRawProviderMetadata + in: query + required: false + schema: + type: boolean + description: Include the data collected from the cloud provider (as is); structure not guaranteed. + default: false + description: Include the data collected from the cloud provider (as is); structure not guaranteed. + responses: + '200': + $ref: ../responses/get200cbiV1InventorySnapshotIdServiceIdResourceDetail.yaml + '400': + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml + description: Invalid request error response. Adjust the request before retrying. + '404': + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml + description: Not found error response. The requested resource does not exist. + '422': + description: Error response. + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml diff --git a/api/services/beci/inventory/paths/cbiV1InventorySnapshotIdServiceIdResourceSummary.yaml b/api/services/beci/inventory/paths/cbiV1InventorySnapshotIdServiceIdResourceSummary.yaml new file mode 100644 index 00000000..38bfc605 --- /dev/null +++ b/api/services/beci/inventory/paths/cbiV1InventorySnapshotIdServiceIdResourceSummary.yaml @@ -0,0 +1,68 @@ +get: + tags: + - Inventory Resources + summary: Get resource summary + description: Returns resource summary for the provided Service ID. + operationId: getResourceSummaryCbiV1InventorySnapshotSnapshotIdServiceServiceIdResourceSummaryGet + parameters: + - name: snapshotId + in: path + required: true + schema: + type: string + format: date-time + description: Snapshot ID + description: Snapshot ID + - name: serviceId + in: path + required: true + schema: + type: string + description: Service ID + description: Service ID + - name: accountId + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Spot account ID + description: Spot account ID + - name: subAccountId + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Subaccount ID + description: Subaccount ID + - name: resourceId + in: query + required: false + schema: + type: string + description: Resource ID. + description: Resource ID. + responses: + '200': + $ref: ../responses/get200cbiV1InventorySnapshotIdServiceIdResourceSummary.yaml + '400': + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml + description: Invalid request error response. Adjust the request before retrying. + '404': + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml + description: Not found error response. The requested resource does not exist. + '422': + description: Error response. + content: + application/json: + schema: + $ref: ../../../../commons/schemas/errorResponse.yaml diff --git a/api/services/beci/inventory/responses/get200cbiV1InventoryService.yaml b/api/services/beci/inventory/responses/get200cbiV1InventoryService.yaml new file mode 100644 index 00000000..336cacc1 --- /dev/null +++ b/api/services/beci/inventory/responses/get200cbiV1InventoryService.yaml @@ -0,0 +1,24 @@ +description: Successful response +content: + application/json: + schema: + allOf: + - $ref: ../../../../commons/schemas/paginatedResponseItemWrapper.yaml + - type: object + properties: + request: + type: object + properties: + url: + example: /cbi/v1/inventory/service + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/serviceResponse.yaml + kind: + example: spotinst:cbi:inventory:service diff --git a/api/services/beci/inventory/responses/get200cbiV1InventoryServiceIdProperty.yaml b/api/services/beci/inventory/responses/get200cbiV1InventoryServiceIdProperty.yaml new file mode 100644 index 00000000..f6d18360 --- /dev/null +++ b/api/services/beci/inventory/responses/get200cbiV1InventoryServiceIdProperty.yaml @@ -0,0 +1,24 @@ +description: Successful response +content: + application/json: + schema: + allOf: + - $ref: ../../../../commons/schemas/paginatedResponseItemWrapper.yaml + - type: object + properties: + request: + type: object + properties: + url: + example: /cbi/v1/inventory/service/{serviceId}/property + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/propertyByServiceResponse.yaml + kind: + example: spotinst:cbi:inventory:property diff --git a/api/services/beci/inventory/responses/get200cbiV1InventoryServiceIdPropertyIdValue.yaml b/api/services/beci/inventory/responses/get200cbiV1InventoryServiceIdPropertyIdValue.yaml new file mode 100644 index 00000000..a6bd7a9f --- /dev/null +++ b/api/services/beci/inventory/responses/get200cbiV1InventoryServiceIdPropertyIdValue.yaml @@ -0,0 +1,24 @@ +description: Successful response +content: + application/json: + schema: + allOf: + - $ref: ../../../../commons/schemas/paginatedResponseItemWrapper.yaml + - type: object + properties: + request: + type: object + properties: + url: + example: /cbi/v1/inventory/service/{serviceId}/property/{propertyName}/value + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/propertyValuesResponse.yaml + kind: + example: spotinst:cbi:inventory:propertyValue diff --git a/api/services/beci/inventory/responses/get200cbiV1InventorySnapshot.yaml b/api/services/beci/inventory/responses/get200cbiV1InventorySnapshot.yaml new file mode 100644 index 00000000..b94396de --- /dev/null +++ b/api/services/beci/inventory/responses/get200cbiV1InventorySnapshot.yaml @@ -0,0 +1,24 @@ +description: Successful response +content: + application/json: + schema: + allOf: + - $ref: ../../../../commons/schemas/paginatedResponseItemWrapper.yaml + - type: object + properties: + request: + type: object + properties: + url: + example: /cbi/v1/inventory/snapshot + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/snapshotResponse.yaml + kind: + example: spotinst:cbi:inventory:snapshot diff --git a/api/services/beci/inventory/responses/get200cbiV1InventorySnapshotIdServiceIdResource.yaml b/api/services/beci/inventory/responses/get200cbiV1InventorySnapshotIdServiceIdResource.yaml new file mode 100644 index 00000000..6a26af06 --- /dev/null +++ b/api/services/beci/inventory/responses/get200cbiV1InventorySnapshotIdServiceIdResource.yaml @@ -0,0 +1,24 @@ +description: Successful response +content: + application/json: + schema: + allOf: + - $ref: ../../../../commons/schemas/paginatedResponseItemWrapper.yaml + - type: object + properties: + request: + type: object + properties: + url: + example: /cbi/v1/inventory/snapshot/{snapshotId}/service/{serviceId}/resource + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/resourceResponse.yaml + kind: + example: spotinst:cbi:inventory:cloudServiceResourceItem diff --git a/api/services/beci/inventory/responses/get200cbiV1InventorySnapshotIdServiceIdResourceDetail.yaml b/api/services/beci/inventory/responses/get200cbiV1InventorySnapshotIdServiceIdResourceDetail.yaml new file mode 100644 index 00000000..0b8656d2 --- /dev/null +++ b/api/services/beci/inventory/responses/get200cbiV1InventorySnapshotIdServiceIdResourceDetail.yaml @@ -0,0 +1,24 @@ +description: Successful response +content: + application/json: + schema: + allOf: + - $ref: ../../../../commons/schemas/responseItemWrapper.yaml + - type: object + properties: + request: + type: object + properties: + url: + example: /cbi/v1/inventory/snapshot/{snapshotId}/service/{serviceId}/resource/detail + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/resourceDetailResponse.yaml + kind: + example: spotinst:cbi:inventory:cloudServiceResourceDetailItem diff --git a/api/services/beci/inventory/responses/get200cbiV1InventorySnapshotIdServiceIdResourceSummary.yaml b/api/services/beci/inventory/responses/get200cbiV1InventorySnapshotIdServiceIdResourceSummary.yaml new file mode 100644 index 00000000..a99daa28 --- /dev/null +++ b/api/services/beci/inventory/responses/get200cbiV1InventorySnapshotIdServiceIdResourceSummary.yaml @@ -0,0 +1,24 @@ +description: Successful response +content: + application/json: + schema: + allOf: + - $ref: ../../../../commons/schemas/responseItemWrapper.yaml + - type: object + properties: + request: + type: object + properties: + url: + example: /cbi/v1/inventory/snapshot/{snapshotId}/service/{serviceId}/resource/summary + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/resourceReportResponse.yaml + kind: + example: spotinst:cbi:inventory:cloudServiceResourceSummary diff --git a/api/services/beci/inventory/schemas/cloudProvider.yaml b/api/services/beci/inventory/schemas/cloudProvider.yaml new file mode 100644 index 00000000..bbb7a2c6 --- /dev/null +++ b/api/services/beci/inventory/schemas/cloudProvider.yaml @@ -0,0 +1,6 @@ +type: string +enum: + - aws + - azure + - gcp +title: CloudProvider diff --git a/api/services/beci/inventory/schemas/panelItem.yaml b/api/services/beci/inventory/schemas/panelItem.yaml new file mode 100644 index 00000000..3c63c838 --- /dev/null +++ b/api/services/beci/inventory/schemas/panelItem.yaml @@ -0,0 +1,28 @@ +properties: + panelType: + type: string + description: Panel type. + panelName: + type: string + description: Panel name. + order: + type: integer + description: Order. + properties: + items: + $ref: panelProperty.yaml + type: array + description: List of properties shown on this panel. + data: + items: + type: object + type: array + description: The data related to this panel. +type: object +required: + - panelType + - panelName + - order + - properties + - data +title: PanelItem diff --git a/api/services/beci/inventory/schemas/panelProperty.yaml b/api/services/beci/inventory/schemas/panelProperty.yaml new file mode 100644 index 00000000..3a9ace47 --- /dev/null +++ b/api/services/beci/inventory/schemas/panelProperty.yaml @@ -0,0 +1,16 @@ +properties: + key: + type: string + description: Property key. + displayName: + type: string + description: Property display name. + valueType: + type: string + description: Property value type. +type: object +required: + - key + - displayName + - valueType +title: PanelProperty diff --git a/api/services/beci/inventory/schemas/propertyByServiceResponse.yaml b/api/services/beci/inventory/schemas/propertyByServiceResponse.yaml new file mode 100644 index 00000000..065449ae --- /dev/null +++ b/api/services/beci/inventory/schemas/propertyByServiceResponse.yaml @@ -0,0 +1,25 @@ +properties: + name: + type: string + description: ID/key of the property. + displayName: + type: string + description: Display name of the property. + type: + type: string + description: Data type of the property. + default: + type: boolean + description: Default property. + supports: + $ref: supportedOptions.yaml + description: Options/features supported by the property. +type: object +required: + - name + - displayName + - type + - default + - supports +title: PropertyByServiceResponse +description: Represents a property. [kind/spotinst:cbi:inventory:property] diff --git a/api/services/beci/inventory/schemas/propertyValuesResponse.yaml b/api/services/beci/inventory/schemas/propertyValuesResponse.yaml new file mode 100644 index 00000000..42728487 --- /dev/null +++ b/api/services/beci/inventory/schemas/propertyValuesResponse.yaml @@ -0,0 +1,8 @@ +properties: + value: + description: Value of the property. +type: object +required: + - value +title: PropertyValuesResponse +description: Represents a property values. [kind/spotinst:cbi:inventory:propertyValue] diff --git a/api/services/beci/inventory/schemas/providerDataItem.yaml b/api/services/beci/inventory/schemas/providerDataItem.yaml new file mode 100644 index 00000000..b41507e0 --- /dev/null +++ b/api/services/beci/inventory/schemas/providerDataItem.yaml @@ -0,0 +1,11 @@ +properties: + key: + type: string + description: Provider data item key. + value: + description: Provider data item value. +type: object +required: + - key + - value +title: ProviderDataItem diff --git a/api/services/beci/inventory/schemas/resourceDetailResponse.yaml b/api/services/beci/inventory/schemas/resourceDetailResponse.yaml new file mode 100644 index 00000000..a7bddf9f --- /dev/null +++ b/api/services/beci/inventory/schemas/resourceDetailResponse.yaml @@ -0,0 +1,61 @@ +properties: + resourceId: + description: Resource identifier. + type: string + nullable: true + resourceName: + description: Resource name. + type: string + nullable: true + resourceType: + description: Resource type. + type: string + nullable: true + tags: + description: Resource tags. + type: object + nullable: true + accountId: + description: '' + type: string + nullable: true + subAccountId: + description: '' + type: string + nullable: true + cloudProvider: + description: '' + type: string + nullable: true + region: + description: Cloud provider region/location. + type: string + nullable: true + creationDate: + description: Resource creation date. + type: string + nullable: true + serviceName: + description: Service name. + type: string + nullable: true + serviceCategory: + description: Service category. + type: string + nullable: true + serviceId: + description: Service Id + type: string + nullable: true + rawProviderData: + description: Cloud provider metadata. + type: object + nullable: true + qualifiedSubAccountId: + type: string + readOnly: true +type: object +required: + - qualifiedSubAccountId +title: ResourceDetailResponse +description: Represents a resource detail. [kind/spotinst:cbi:inventory:cloudServiceResourceDetailItem] diff --git a/api/services/beci/inventory/schemas/resourceReportResponse.yaml b/api/services/beci/inventory/schemas/resourceReportResponse.yaml new file mode 100644 index 00000000..73e65159 --- /dev/null +++ b/api/services/beci/inventory/schemas/resourceReportResponse.yaml @@ -0,0 +1,11 @@ +properties: + panels: + items: + $ref: panelItem.yaml + type: array + description: List of panel items. +type: object +required: + - panels +title: ResourceReportResponse +description: Represents a resource summary. [kind/spotinst:cbi:inventory:cloudServiceResourceSummary] diff --git a/api/services/beci/inventory/schemas/resourceResponse.yaml b/api/services/beci/inventory/schemas/resourceResponse.yaml new file mode 100644 index 00000000..e96d237d --- /dev/null +++ b/api/services/beci/inventory/schemas/resourceResponse.yaml @@ -0,0 +1,63 @@ +properties: + resourceId: + description: Resource identifier. + type: string + nullable: true + resourceName: + description: Resource name. + type: string + nullable: true + resourceType: + description: Resource type. + type: string + nullable: true + tags: + description: Resource tags. + type: object + nullable: true + accountId: + description: '' + type: string + nullable: true + subAccountId: + description: '' + type: string + nullable: true + cloudProvider: + description: '' + type: string + nullable: true + region: + description: Cloud provider region/location. + type: string + nullable: true + creationDate: + description: Resource creation date. + type: string + nullable: true + serviceName: + description: Service name. + type: string + nullable: true + serviceCategory: + description: Service category. + type: string + nullable: true + serviceId: + description: Service Id + type: string + nullable: true + providerData: + description: Selected cloud provider metadata. + type: array + items: + $ref: providerDataItem.yaml + nullable: true + qualifiedSubAccountId: + type: string + readOnly: true +type: object +required: + - qualifiedSubAccountId +title: ResourceResponse +description: Represents a resource. [kind/spotinst:cbi:inventory:cloudServiceResourceItem] diff --git a/api/services/beci/inventory/schemas/serviceResponse.yaml b/api/services/beci/inventory/schemas/serviceResponse.yaml new file mode 100644 index 00000000..cc3fd67a --- /dev/null +++ b/api/services/beci/inventory/schemas/serviceResponse.yaml @@ -0,0 +1,29 @@ +properties: + serviceId: + type: string + description: Service ID. + displayName: + type: string + description: Service display value. + providerName: + type: string + description: Cloud provider. + serviceName: + type: string + description: Cloud service that manages the resource. + resourceType: + type: string + description: Resource type. + serviceCategory: + type: string + description: Service type. +type: object +required: + - serviceId + - displayName + - providerName + - serviceName + - resourceType + - serviceCategory +title: ServiceResponse +description: Represents a service. [kind/spotinst:cbi:inventory:service] diff --git a/api/services/beci/inventory/schemas/snapshotResponse.yaml b/api/services/beci/inventory/schemas/snapshotResponse.yaml new file mode 100644 index 00000000..eaf8af6b --- /dev/null +++ b/api/services/beci/inventory/schemas/snapshotResponse.yaml @@ -0,0 +1,14 @@ +properties: + id: + type: string + description: ID of the snapshot. + snapshotDate: + type: string + format: date-time + description: Timestamp used to "best represent" the point in time that the data being viewed represents. +type: object +required: + - id + - snapshotDate +title: SnapshotResponse +description: Represents a snapshot. [kind/spotinst:cbi:inventory:snapshot] diff --git a/api/services/beci/inventory/schemas/supportedOptions.yaml b/api/services/beci/inventory/schemas/supportedOptions.yaml new file mode 100644 index 00000000..fc92caaf --- /dev/null +++ b/api/services/beci/inventory/schemas/supportedOptions.yaml @@ -0,0 +1,13 @@ +properties: + select: + type: boolean + description: Property can be selected in the inventory list API. + filter: + type: boolean + description: Property can be filtered in the inventory list API. +type: object +required: + - select + - filter +title: SupportedOptions +description: Represents the options/features supported by a property. diff --git a/api/spot.yaml b/api/spot.yaml index 93f00d90..594975b2 100644 --- a/api/spot.yaml +++ b/api/spot.yaml @@ -180,6 +180,21 @@ tags: - name: Insights Service + - name: Inventory Snapshots + description: Cost Intelligence - Inventory Snapshots + externalDocs: + url: https://docs.spot.io/cost-intelligence/ + + - name: Inventory Resources + description: Cost Intelligence - Inventory Resources + externalDocs: + url: https://docs.spot.io/cost-intelligence/ + + - name: Inventory Services + description: Cost Intelligence - Inventory Services + externalDocs: + url: https://docs.spot.io/cost-intelligence/ + x-tagGroups: - name: Administration tags: @@ -225,6 +240,11 @@ x-tagGroups: - Compliance - Misconfiguration - Assets + - name: Cost Intelligence + tags: + - Inventory Snapshots + - Inventory Resources + - Inventory Services paths: /aws/ec2/group: @@ -966,4 +986,18 @@ paths: $ref: services/beci/setup/paths/cloudBillingV1SetupAccount.yaml /cloudBilling/v1/setup/account/validation: $ref: services/beci/setup/paths/cloudBillingV1SetupAccountValidation.yaml + /cbi/v1/inventory/snapshot: + $ref: services/beci/inventory/paths/cbiV1InventorySnapshot.yaml + /cbi/v1/inventory/snapshot/{snapshotId}/service/{serviceId}/resource: + $ref: services/beci/inventory/paths/cbiV1InventorySnapshotIdServiceIdResource.yaml + /cbi/v1/inventory/service: + $ref: services/beci/inventory/paths/cbiV1InventoryService.yaml + /cbi/v1/inventory/service/{serviceId}/property: + $ref: services/beci/inventory/paths/cbiV1InventoryServiceIdProperty.yaml + /cbi/v1/inventory/service/{serviceId}/property/{propertyName}/value: + $ref: services/beci/inventory/paths/cbiV1InventoryServiceIdPropertyIdValue.yaml + /cbi/v1/inventory/snapshot/{snapshotId}/service/{serviceId}/resource/detail: + $ref: services/beci/inventory/paths/cbiV1InventorySnapshotIdServiceIdResourceDetail.yaml + /cbi/v1/inventory/snapshot/{snapshotId}/service/{serviceId}/resource/summary: + $ref: services/beci/inventory/paths/cbiV1InventorySnapshotIdServiceIdResourceSummary.yaml #