diff --git a/api/services/beci/bestPractice/paths/cbiV1BestPracticeAssessment.yaml b/api/services/beci/bestPractice/paths/cbiV1BestPracticeAssessment.yaml new file mode 100644 index 00000000..d9d4a367 --- /dev/null +++ b/api/services/beci/bestPractice/paths/cbiV1BestPracticeAssessment.yaml @@ -0,0 +1,92 @@ +get: + tags: + - Best Practice Check Assessments + summary: Get Assessments + description: Returns a list of assessments and the number of infractions for the specified assessment. + operationId: getAssessmentsCbiV1BestPracticeAssessmentGet + 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, the assessment must have analyzed a snapshot after this timestamp. + description: If specified, the assessment must have analyzed a snapshot after this timestamp. + - name: maxSnapshotDate + in: query + required: false + schema: + anyOf: + - type: string + format: date-time + - type: 'null' + description: If specified, the assessment must have analyzed a snapshot before this timestamp. + description: If specified, the assessment must have analyzed a snapshot before 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/get200cbiV1BestPracticeAssessment.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/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheck.yaml b/api/services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheck.yaml new file mode 100644 index 00000000..47151b16 --- /dev/null +++ b/api/services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheck.yaml @@ -0,0 +1,193 @@ +get: + tags: + - Best Practice Checks + summary: Get Checks + description: Returns a list of checks and infraction counts for the assessment. + operationId: getChecksCbiV1BestPracticeAssessmentAssessmentIdCheckGet + parameters: + - name: assessmentId + in: path + required: true + schema: + type: string + description: Assessment ID + description: Assessment ID + - name: ordering + in: query + required: false + schema: + type: string + description: Sort order of the fields in the list, separated by commas. + description: Sort order of the fields in the list, separated by commas. + - 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: category + in: query + required: false + schema: + anyOf: + - type: array + items: + $ref: ../schemas/checkCategoryEnum.yaml + - type: 'null' + description: Identifier of the check type. + description: Identifier of the check type. + - name: source + in: query + required: false + schema: + anyOf: + - type: array + items: + $ref: ../schemas/checkDefintionSource.yaml + - type: 'null' + description: Check source. + description: Check source. + - name: importance + in: query + required: false + schema: + anyOf: + - type: array + items: + $ref: ../schemas/checkImportanceEnum.yaml + - type: 'null' + description: The importance or impact of the check. + description: The importance or impact of the check. + - name: targetedServiceCategory + in: query + required: false + schema: + anyOf: + - type: array + items: + $ref: ../schemas/serviceTypeEnum.yaml + - type: 'null' + description: The targeted service category of the check. + description: The targeted service category of the check. + - name: supportsAutoRemediation + in: query + required: false + schema: + anyOf: + - type: array + items: + type: boolean + - type: 'null' + description: None returns all the checks. True returns only checks that support auto remediation. False returns only checks that do not support auto remediation. + description: None returns all the checks. True returns only checks that support auto remediation. False returns only checks that do not support auto remediation. + - name: providerName + in: query + required: false + schema: + type: array + items: + $ref: ../schemas/cloudProvider.yaml + description: Cloud Provider(s) + default: [] + description: Cloud Provider(s) + - name: manualRemediationAvailable + in: query + required: false + schema: + anyOf: + - type: array + items: + type: boolean + - type: 'null' + description: None returns all the checks. True returns only checks that support manual remediation. False returns only checks that do not support manual remediation. + description: None returns all the checks. True returns only checks that support manual remediation. False returns only checks that do not support manual remediation. + - name: remediationEffort + in: query + required: false + schema: + anyOf: + - type: array + items: + $ref: ../schemas/remediationEffortEnum.yaml + - type: 'null' + description: The remediation effort of the check. + description: The remediation effort of the check. + - name: includeChecksWithNoFailures + in: query + required: false + schema: + anyOf: + - type: boolean + - type: 'null' + description: Include/exclude checks with an infractionCount of 0. + default: true + description: Include/exclude checks with an infractionCount of 0. + - name: name + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Check Name + description: Check Name + - name: supportsManagedByOcean + in: query + required: false + schema: + anyOf: + - type: array + items: + type: boolean + - type: 'null' + description: None returns all the checks. True returns only checks that support managed by Ocean. False returns only checks that do not support managed by Ocean. + description: None returns all the checks. True returns only checks that support managed by Ocean. False returns only checks that do not support managed by Ocean. + responses: + '200': + $ref: ../responses/get200cbiV1BestPracticeAssessmentIdCheck.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/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheckId.yaml b/api/services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheckId.yaml new file mode 100644 index 00000000..d56ca839 --- /dev/null +++ b/api/services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheckId.yaml @@ -0,0 +1,100 @@ +get: + tags: + - Best Practice Checks + summary: Get Check Detail + description: Returns a list of details for the assessment check. + operationId: getCheckDetailCbiV1BestPracticeAssessmentAssessmentIdCheckCheckIdGet + parameters: + - name: assessmentId + in: path + required: true + schema: + type: string + description: Assessment ID + description: Assessment ID + - name: checkId + in: path + required: true + schema: + type: string + description: Check ID + description: Check ID + - name: ordering + in: query + required: false + schema: + type: string + description: Sort order of the fields in the list, separated by commas. + description: Sort order of the fields in the list, separated by commas. + - 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: filter + in: query + required: false + schema: + type: string + description: Filter expression. + description: Filter expression. + - 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/get200cbiV1BestPracticeAssessmentIdCheckId.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/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheckIdPropertyIdValue.yaml b/api/services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheckIdPropertyIdValue.yaml new file mode 100644 index 00000000..10895599 --- /dev/null +++ b/api/services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheckIdPropertyIdValue.yaml @@ -0,0 +1,102 @@ +get: + tags: + - Best Practice Checks + summary: Get Check Detail Property Values + description: Returns a list of unique values for a check detail property. + operationId: getCheckDetailPropertyValuesCbiV1BestPracticeAssessmentAssessmentIdCheckCheckIdPropertyPropertyNameValueGet + parameters: + - name: assessmentId + in: path + required: true + schema: + type: string + description: Assessment ID + description: Assessment ID + - name: checkId + in: path + required: true + schema: + type: string + description: Check ID + description: Check ID + - name: propertyName + in: path + required: true + schema: + type: string + description: Name of the check detail property. + description: Name of the check detail property. + - 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: 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/get200cbiV1BestPracticeAssessmentIdCheckIdPropertyIdValue.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/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheckIdSummary.yaml b/api/services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheckIdSummary.yaml new file mode 100644 index 00000000..1eb7b9c0 --- /dev/null +++ b/api/services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheckIdSummary.yaml @@ -0,0 +1,82 @@ +get: + tags: + - Best Practice Checks + summary: Get Check Detail Summary + description: Returns the total sum for the estimated cost and potential savings fields for an assessment check. + operationId: getCheckDetailSummaryCbiV1BestPracticeAssessmentAssessmentIdCheckCheckIdSummaryGet + parameters: + - name: assessmentId + in: path + required: true + schema: + type: string + description: Assessment ID + description: Assessment ID + - name: checkId + in: path + required: true + schema: + type: string + description: Check ID + description: Check ID + - 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: groupBy + in: query + required: false + schema: + anyOf: + - $ref: ../schemas/checkDetailSummaryEnum.yaml + - type: 'null' + description: Identifier of which unit to group by + default: currency + description: Identifier of which unit to group by + - 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/get200cbiV1BestPracticeAssessmentIdCheckIdSummary.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/bestPractice/paths/cbiV1BestPracticeAssessmentIdPropertyIdValue.yaml b/api/services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdPropertyIdValue.yaml new file mode 100644 index 00000000..8576ff61 --- /dev/null +++ b/api/services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdPropertyIdValue.yaml @@ -0,0 +1,95 @@ +get: + tags: + - Best Practice Checks + summary: Get Check Property Values + description: Returns a list of unique values for a check property. + operationId: getCheckPropertyValuesCbiV1BestPracticeAssessmentAssessmentIdPropertyPropertyNameValueGet + parameters: + - name: assessmentId + in: path + required: true + schema: + type: string + description: Assessment ID + description: Assessment 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: 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/get200cbiV1BestPracticeAssessmentIdPropertyIdValue.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/bestPractice/paths/cbiV1BestPracticeAssessmentIdSummary.yaml b/api/services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdSummary.yaml new file mode 100644 index 00000000..234db518 --- /dev/null +++ b/api/services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdSummary.yaml @@ -0,0 +1,75 @@ +get: + tags: + - Best Practice Checks + summary: Get Checks Grouped by Property + description: Returns the number of failed resources and qualifying checks based on the property the assessment is grouped by. + operationId: getChecksGroupedByPropertyCbiV1BestPracticeAssessmentAssessmentIdSummaryGet + parameters: + - name: assessmentId + in: path + required: true + schema: + type: string + description: Assessment ID + description: Assessment ID + - 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: groupBy + in: query + required: false + schema: + anyOf: + - $ref: ../schemas/checkSummaryEnum.yaml + - type: 'null' + description: Identifier of which property to group by + default: importance + description: Identifier of which property to group by + - 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/get200cbiV1BestPracticeAssessmentIdSummary.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/bestPractice/paths/cbiV1BestPracticeCheckDefinitionId.yaml b/api/services/beci/bestPractice/paths/cbiV1BestPracticeCheckDefinitionId.yaml new file mode 100644 index 00000000..eb306e01 --- /dev/null +++ b/api/services/beci/bestPractice/paths/cbiV1BestPracticeCheckDefinitionId.yaml @@ -0,0 +1,35 @@ +get: + tags: + - Best Practice Check Definitions + summary: Get Check Definition + description: Gives the details of the check definition. + operationId: getCheckDefinitionCbiV1BestPracticeCheckDefinitionCheckIdGet + parameters: + - name: checkId + in: path + required: true + schema: + type: string + description: Check ID + description: Check ID + responses: + '200': + $ref: ../responses/get200cbiV1BestPracticeCheckDefinitionId.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/bestPractice/responses/get200cbiV1BestPracticeAssessment.yaml b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessment.yaml new file mode 100644 index 00000000..b6604db1 --- /dev/null +++ b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessment.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/bestPractice/assessment + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/assessmentResponse.yaml + kind: + example: spotinst:cbi:bestPractice:assessment diff --git a/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdCheck.yaml b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdCheck.yaml new file mode 100644 index 00000000..afbef99c --- /dev/null +++ b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdCheck.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/bestPractice/assessment/{assessmentId}/check + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/checkResponse.yaml + kind: + example: spotinst:cbi:bestPractice:assessment:check diff --git a/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdCheckId.yaml b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdCheckId.yaml new file mode 100644 index 00000000..2b0e285c --- /dev/null +++ b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdCheckId.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/bestPractice/assessment/{assessmentId}/check/{checkId} + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/checkDetailResponse.yaml + kind: + example: spotinst:cbi:bestPractice:assessment:checkDetail diff --git a/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdCheckIdPropertyIdValue.yaml b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdCheckIdPropertyIdValue.yaml new file mode 100644 index 00000000..b0bc114b --- /dev/null +++ b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdCheckIdPropertyIdValue.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/bestPractice/assessment/{assessmentId}/check/{checkId}/property/{propertyName}/value + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/checkDetailPropertyValuesResponse.yaml + kind: + example: spotinst:cbi:bestPractice:assessment:check:property:value diff --git a/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdCheckIdSummary.yaml b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdCheckIdSummary.yaml new file mode 100644 index 00000000..13e7edbd --- /dev/null +++ b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdCheckIdSummary.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/bestPractice/assessment/{assessmentId}/check/{checkId}/summary + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/checkDetailSummaryResponse.yaml + kind: + example: spotinst:cbi:bestPractice:assessment:checkDetail:summary diff --git a/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdPropertyIdValue.yaml b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdPropertyIdValue.yaml new file mode 100644 index 00000000..d8ee4c4a --- /dev/null +++ b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdPropertyIdValue.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/bestPractice/assessment/{assessmentId}/property/{propertyName}/value + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/checkPropertyValuesResponse.yaml + kind: + example: spotinst:cbi:bestPractice:assessment:property:value diff --git a/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdSummary.yaml b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdSummary.yaml new file mode 100644 index 00000000..6d3a0505 --- /dev/null +++ b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeAssessmentIdSummary.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/bestPractice/assessment/{assessmentId}/summary + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/checkSummaryResponse.yaml + kind: + example: spotinst:cbi:bestPractice:assessment:checkSummary diff --git a/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeCheckDefinitionId.yaml b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeCheckDefinitionId.yaml new file mode 100644 index 00000000..16a2260d --- /dev/null +++ b/api/services/beci/bestPractice/responses/get200cbiV1BestPracticeCheckDefinitionId.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/bestPractice/checkDefinition/{checkId} + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/checkDefinitionBody.yaml + kind: + example: spotinst:cbi:bestPractice:checkDefinition diff --git a/api/services/beci/bestPractice/schemas/assessmentResponse.yaml b/api/services/beci/bestPractice/schemas/assessmentResponse.yaml new file mode 100644 index 00000000..52bea993 --- /dev/null +++ b/api/services/beci/bestPractice/schemas/assessmentResponse.yaml @@ -0,0 +1,23 @@ +properties: + id: + type: string + description: ID of the best practice check assessment. + snapshotDate: + type: string + format: date-time + description: Timestamp of the snapshot that was analyzed. + startedDate: + type: string + format: date-time + description: Timestamp indicating when the analysis was started. + infractionCount: + type: integer + description: Number of infractions detected for the specified assessment. +type: object +required: + - id + - snapshotDate + - startedDate + - infractionCount +title: AssessmentResponse +description: Represents a best practice assessment. [kind/spotinst:cbi:bestPractice:assessment] diff --git a/api/services/beci/bestPractice/schemas/checkCategoryEnum.yaml b/api/services/beci/bestPractice/schemas/checkCategoryEnum.yaml new file mode 100644 index 00000000..f919eb44 --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkCategoryEnum.yaml @@ -0,0 +1,7 @@ +type: string +enum: + - usage + - security + - cost + - availability +title: CheckCategoryEnum diff --git a/api/services/beci/bestPractice/schemas/checkDefinitionBody.yaml b/api/services/beci/bestPractice/schemas/checkDefinitionBody.yaml new file mode 100644 index 00000000..f580585b --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkDefinitionBody.yaml @@ -0,0 +1,87 @@ +properties: + id: + type: string + description: Unique check identifier. + name: + type: string + description: Name of the check. + description: + type: string + description: Description of the check. + longDescription: + type: string + description: Additional details about the check and how it works. The long description is returned as a partial HTML string. + importance: + $ref: checkImportanceEnum.yaml + description: The check's importance level. + source: + $ref: checkSourceEnum.yaml + description: The source of the check. + category: + $ref: checkCategoryEnum.yaml + description: The check's category or grouping, e.g. cost, security. + cloudProviders: + items: + type: string + type: array + configuration: + items: + $ref: configurationValueDefinition.yaml + type: array + metadata: + items: + $ref: metadataDefinition.yaml + type: array + validFrom: + type: string + format: date-time + description: The date from which this check is valid. + validTo: + description: The date until which this check is valid. + type: string + nullable: true + targetedServiceCategory: + $ref: serviceTypeEnum.yaml + description: The service type this check falls into. + supportsAutoRemediation: + type: boolean + description: If the check supports auto remediation. + default: false + defaultRemediationTemplate: + description: Default remediation template ID. + type: string + nullable: true + manualRemediationAvailable: + description: If manual remediation is available for the check. + default: false + type: boolean + nullable: true + remediationEffort: + description: The level of effort for manual remediation. + default: n/a + $ref: remediationEffortEnum.yaml + nullable: true + supportsManagedByOcean: + type: boolean + description: If this check can be managed by Ocean. + default: false + ctaUrl: + description: Call to action URL. + type: string + nullable: true +type: object +required: + - id + - name + - description + - longDescription + - importance + - source + - category + - cloudProviders + - configuration + - metadata + - validFrom + - targetedServiceCategory +title: CheckDefinitionBody +description: Represents a best practice check definition. [kind/spotinst:cbi:bestPractice:checkDefinition] diff --git a/api/services/beci/bestPractice/schemas/checkDefintionSource.yaml b/api/services/beci/bestPractice/schemas/checkDefintionSource.yaml new file mode 100644 index 00000000..5518eb65 --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkDefintionSource.yaml @@ -0,0 +1,6 @@ +type: string +enum: + - Cost Intelligence + - AWS Trusted Advisor + - Microsoft Azure Advisor +title: CheckDefintionSource diff --git a/api/services/beci/bestPractice/schemas/checkDetailMetadataValue.yaml b/api/services/beci/bestPractice/schemas/checkDetailMetadataValue.yaml new file mode 100644 index 00000000..b8af4255 --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkDetailMetadataValue.yaml @@ -0,0 +1,7 @@ +properties: + value: + description: Metadata value. +type: object +required: + - value +title: CheckDetailMetadataValue diff --git a/api/services/beci/bestPractice/schemas/checkDetailPropertyValuesResponse.yaml b/api/services/beci/bestPractice/schemas/checkDetailPropertyValuesResponse.yaml new file mode 100644 index 00000000..e84555b9 --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkDetailPropertyValuesResponse.yaml @@ -0,0 +1,8 @@ +properties: + value: + description: Value of the check detail property. +type: object +required: + - value +title: CheckDetailPropertyValuesResponse +description: Represents a best practice assessment check property value. [kind/spotinst:cbi:bestPractice:assessment:check:property:value] diff --git a/api/services/beci/bestPractice/schemas/checkDetailResponse.yaml b/api/services/beci/bestPractice/schemas/checkDetailResponse.yaml new file mode 100644 index 00000000..25245194 --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkDetailResponse.yaml @@ -0,0 +1,90 @@ +properties: + resourceId: + type: string + description: Identifier for the resource that caused the infraction. + accountId: + type: string + description: Spot Account ID. + subAccountId: + description: SubAccount ID. + type: string + nullable: true + providerName: + type: string + description: Cloud provider that the resource is associated with. + serviceName: + type: string + description: Cloud service. + serviceId: + type: string + description: Service ID. + serviceDisplayName: + type: string + description: Service display name. + resourceType: + type: string + description: Resource type. + resourceName: + type: string + description: Resource name. + tags: + description: Resource tags. + type: object + nullable: true + region: + description: Cloud provider region where the resource is located. + type: string + nullable: true + metadata: + $ref: rootModelDictStrCheckDetailMetadataValue__.yaml + description: Metadata about the resource that is relevant to the check. + targetedServiceCategory: + $ref: serviceTypeEnum.yaml + description: The targeted service category of the check. + manualRemediationAvailable: + type: boolean + description: If manual remediation is available for the check. + supportsManagedByOcean: + type: boolean + description: If managed by Ocean is available for the check. + remediationEffort: + description: The effort level for manual remediation. + $ref: remediationEffortEnum.yaml + nullable: true + daysOpen: + description: Number of days open based on first discovered. + type: integer + nullable: true + firstDiscovered: + description: Timestamp of the assessment when the infraction was first discovered. + type: string + nullable: true + lastScanned: + description: Timestamp of the assessment that the infraction was last scanned. + type: string + nullable: true + ctaUrl: + description: Call to action URL. + type: string + nullable: true + qualifiedSubAccountId: + type: string + readOnly: true +type: object +required: + - resourceId + - accountId + - providerName + - serviceName + - serviceId + - serviceDisplayName + - resourceType + - resourceName + - metadata + - targetedServiceCategory + - manualRemediationAvailable + - supportsManagedByOcean + - remediationEffort + - qualifiedSubAccountId +title: CheckDetailResponse +description: Represents a best practice assessment check detail. [kind/spotinst:cbi:bestPractice:assessment:checkDetail] diff --git a/api/services/beci/bestPractice/schemas/checkDetailSummaryAggregateItem.yaml b/api/services/beci/bestPractice/schemas/checkDetailSummaryAggregateItem.yaml new file mode 100644 index 00000000..ef2d21c9 --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkDetailSummaryAggregateItem.yaml @@ -0,0 +1,18 @@ +properties: + groupByValue: + type: string + description: The description for the field that the checks are grouped by. + value: + type: number + description: The aggregated sum of values for the group by value. + currency: + description: Currency format. Defaults to $. + default: $ + type: string + nullable: true +type: object +required: + - groupByValue + - value +title: CheckDetailSummaryAggregateItem +description: Represents a best practice assessment check detail summary aggregate item. diff --git a/api/services/beci/bestPractice/schemas/checkDetailSummaryEnum.yaml b/api/services/beci/bestPractice/schemas/checkDetailSummaryEnum.yaml new file mode 100644 index 00000000..57b511d3 --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkDetailSummaryEnum.yaml @@ -0,0 +1,4 @@ +type: string +enum: + - currency +title: CheckDetailSummaryEnum diff --git a/api/services/beci/bestPractice/schemas/checkDetailSummaryResponse.yaml b/api/services/beci/bestPractice/schemas/checkDetailSummaryResponse.yaml new file mode 100644 index 00000000..b79bd2a1 --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkDetailSummaryResponse.yaml @@ -0,0 +1,28 @@ +properties: + assessmentId: + type: string + description: The specified assessment that the checks have been aggregated for. + snapshotDate: + type: string + format: date-time + description: The snapshot date for the specified assessment that the checks have been aggregated for. + groupBy: + $ref: checkDetailSummaryEnum.yaml + description: The property that the checks are aggregated by. + aggregates: + items: + $ref: checkDetailSummaryAggregateItem.yaml + type: array + description: Summary items for each property value for the group by property. + checkId: + type: string + description: Check ID +type: object +required: + - assessmentId + - snapshotDate + - groupBy + - aggregates + - checkId +title: CheckDetailSummaryResponse +description: Represents a best practice assessment check detail summary. [kind/spotinst:cbi:bestPractice:assessment:checkDetail:summary] diff --git a/api/services/beci/bestPractice/schemas/checkImportanceEnum.yaml b/api/services/beci/bestPractice/schemas/checkImportanceEnum.yaml new file mode 100644 index 00000000..913c0efd --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkImportanceEnum.yaml @@ -0,0 +1,6 @@ +type: string +enum: + - low + - medium + - high +title: CheckImportanceEnum diff --git a/api/services/beci/bestPractice/schemas/checkPropertyValuesResponse.yaml b/api/services/beci/bestPractice/schemas/checkPropertyValuesResponse.yaml new file mode 100644 index 00000000..8ca0420f --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkPropertyValuesResponse.yaml @@ -0,0 +1,8 @@ +properties: + value: + description: Value of the check property. +type: object +required: + - value +title: CheckPropertyValuesResponse +description: Represents a best practice assessment property value. [kind/spotinst:cbi:bestPractice:assessment:property:value] diff --git a/api/services/beci/bestPractice/schemas/checkResponse.yaml b/api/services/beci/bestPractice/schemas/checkResponse.yaml new file mode 100644 index 00000000..561ddb45 --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkResponse.yaml @@ -0,0 +1,79 @@ +properties: + id: + type: string + description: Unique check identifier. + name: + type: string + description: Name of the check (customer facing). + importance: + type: string + enum: + - low + - medium + - high + description: The importance or impact of the check. + category: + type: string + enum: + - usage + - security + - cost + - availability + description: Identifier of the check type. Grouping mechanism. + targetedServiceCategory: + $ref: serviceTypeEnum.yaml + description: The targeted service category of the check. + description: + type: string + description: Short description of what the check is doing. + cloudProviders: + items: + type: string + type: array + description: The cloud providers to which this check applies. + infractionCount: + type: integer + description: Number of infractions detected for the specified assessment. + supportsAutoRemediation: + type: boolean + description: If the check supports auto remediation. + defaultRemediationTemplate: + description: Default remediation template ID. + type: string + nullable: true + manualRemediationAvailable: + type: boolean + description: If manual remediation is available for the check. + remediationEffort: + description: The effort level for manual remediation. + $ref: remediationEffortEnum.yaml + nullable: true + source: + description: Display check source. + $ref: checkDefintionSource.yaml + nullable: true + supportsManagedByOcean: + type: boolean + description: If this check can be managed by Ocean. + default: false + ctaUrl: + description: Call to action URL. + type: string + nullable: true +type: object +required: + - id + - name + - importance + - category + - targetedServiceCategory + - description + - cloudProviders + - infractionCount + - supportsAutoRemediation + - defaultRemediationTemplate + - manualRemediationAvailable + - remediationEffort + - source +title: CheckResponse +description: Represents a best practice assessment check. [kind/spotinst:cbi:bestPractice:assessment:check] diff --git a/api/services/beci/bestPractice/schemas/checkSourceEnum.yaml b/api/services/beci/bestPractice/schemas/checkSourceEnum.yaml new file mode 100644 index 00000000..923bda09 --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkSourceEnum.yaml @@ -0,0 +1,8 @@ +type: string +enum: + - AWS Trusted Advisor + - Microsoft Azure Advisor + - Google Cloud Recommender + - Ocean + - Cost Intelligence +title: CheckSourceEnum diff --git a/api/services/beci/bestPractice/schemas/checkSummaryAggregateItem.yaml b/api/services/beci/bestPractice/schemas/checkSummaryAggregateItem.yaml new file mode 100644 index 00000000..795a980e --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkSummaryAggregateItem.yaml @@ -0,0 +1,17 @@ +properties: + groupByValue: + type: string + description: The value for the property that the checks are grouped by. + numberOfFailedResources: + type: integer + description: Number of infractions detected for the specified assessment for the group by property value. + numberOfQualifyingChecks: + type: integer + description: Number of infractions detected for the specified assessment for the group by property value. +type: object +required: + - groupByValue + - numberOfFailedResources + - numberOfQualifyingChecks +title: CheckSummaryAggregateItem +description: Represents a best practice assessment check summary aggregate item. diff --git a/api/services/beci/bestPractice/schemas/checkSummaryEnum.yaml b/api/services/beci/bestPractice/schemas/checkSummaryEnum.yaml new file mode 100644 index 00000000..d36865ef --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkSummaryEnum.yaml @@ -0,0 +1,6 @@ +type: string +enum: + - importance + - category + - source +title: CheckSummaryEnum diff --git a/api/services/beci/bestPractice/schemas/checkSummaryResponse.yaml b/api/services/beci/bestPractice/schemas/checkSummaryResponse.yaml new file mode 100644 index 00000000..f337e087 --- /dev/null +++ b/api/services/beci/bestPractice/schemas/checkSummaryResponse.yaml @@ -0,0 +1,24 @@ +properties: + assessmentId: + type: string + description: The specified assessment that the checks have been aggregated for. + snapshotDate: + type: string + format: date-time + description: The snapshot date for the specified assessment that the checks have been aggregated for. + groupBy: + $ref: checkSummaryEnum.yaml + description: The property that the checks are aggregated by. + aggregates: + items: + $ref: checkSummaryAggregateItem.yaml + type: array + description: Summary items for each property value for the group by property. +type: object +required: + - assessmentId + - snapshotDate + - groupBy + - aggregates +title: CheckSummaryResponse +description: Represents a best practice assessment check summary. [kind/spotinst:cbi:bestPractice:assessment:checkSummary] diff --git a/api/services/beci/bestPractice/schemas/cloudProvider.yaml b/api/services/beci/bestPractice/schemas/cloudProvider.yaml new file mode 100644 index 00000000..bbb7a2c6 --- /dev/null +++ b/api/services/beci/bestPractice/schemas/cloudProvider.yaml @@ -0,0 +1,6 @@ +type: string +enum: + - aws + - azure + - gcp +title: CloudProvider diff --git a/api/services/beci/bestPractice/schemas/configurationValueDefinition.yaml b/api/services/beci/bestPractice/schemas/configurationValueDefinition.yaml new file mode 100644 index 00000000..1e086f5c --- /dev/null +++ b/api/services/beci/bestPractice/schemas/configurationValueDefinition.yaml @@ -0,0 +1,24 @@ +properties: + key: + type: string + description: Unique configuration value key / ID. + name: + type: string + description: Name of the configuration value. + description: + type: string + description: Description for the configuration value. + valueType: + type: string + description: Defines the type of value that must be specified for the configuration value. + defaultValue: + type: string + description: Default value for the configuration value. +type: object +required: + - key + - name + - description + - valueType + - defaultValue +title: ConfigurationValueDefinition diff --git a/api/services/beci/bestPractice/schemas/metadataDefinition.yaml b/api/services/beci/bestPractice/schemas/metadataDefinition.yaml new file mode 100644 index 00000000..261965cd --- /dev/null +++ b/api/services/beci/bestPractice/schemas/metadataDefinition.yaml @@ -0,0 +1,28 @@ +properties: + key: + type: string + description: Unique metadata entry key / ID. + name: + type: string + description: Name of the metadata entry. + description: + type: string + description: Description for the metadata entry. + valueType: + type: string + description: Defines the type of value that is captured for this metadata entry. + unit: + description: The unit for the value captured for this metadata entry (such as currency, percent, MB). + type: string + nullable: true + decimalPlaces: + description: For a numeric value, specifies the number of relevant decimal places (for display to the user). + type: integer + nullable: true +type: object +required: + - key + - name + - description + - valueType +title: MetadataDefinition diff --git a/api/services/beci/bestPractice/schemas/remediationEffortEnum.yaml b/api/services/beci/bestPractice/schemas/remediationEffortEnum.yaml new file mode 100644 index 00000000..1d6d838b --- /dev/null +++ b/api/services/beci/bestPractice/schemas/remediationEffortEnum.yaml @@ -0,0 +1,7 @@ +type: string +enum: + - easy + - intermediate + - difficult + - n/a +title: RemediationEffortEnum diff --git a/api/services/beci/bestPractice/schemas/rootModelDictStrCheckDetailMetadataValue__.yaml b/api/services/beci/bestPractice/schemas/rootModelDictStrCheckDetailMetadataValue__.yaml new file mode 100644 index 00000000..272f086a --- /dev/null +++ b/api/services/beci/bestPractice/schemas/rootModelDictStrCheckDetailMetadataValue__.yaml @@ -0,0 +1,4 @@ +additionalProperties: + $ref: checkDetailMetadataValue.yaml +type: object +title: RootModel[Dict[str, CheckDetailMetadataValue]] diff --git a/api/services/beci/bestPractice/schemas/serviceTypeEnum.yaml b/api/services/beci/bestPractice/schemas/serviceTypeEnum.yaml new file mode 100644 index 00000000..4d79f608 --- /dev/null +++ b/api/services/beci/bestPractice/schemas/serviceTypeEnum.yaml @@ -0,0 +1,22 @@ +type: string +enum: + - Data Analytics + - API Management + - Application Services + - Artificial Intelligence & ML + - Cloud Marketplace + - Compute + - Database + - Developer Tools + - Hybrid and Multi-Cloud + - IoT + - Media + - Management & Governance + - Management Tools + - Migration + - Networking + - Operations + - Other + - Security + - Storage +title: ServiceTypeEnum diff --git a/api/spot.yaml b/api/spot.yaml index aad59f86..bae020f9 100644 --- a/api/spot.yaml +++ b/api/spot.yaml @@ -180,6 +180,21 @@ tags: - name: Insights Service + - name: Best Practice Check Assessments + description: Cost Intelligence - Best Practice Check Assessments + externalDocs: + url: https://docs.spot.io/cost-intelligence/ + + - name: Best Practice Checks + description: Cost Intelligence - Best Practice Checks + externalDocs: + url: https://docs.spot.io/cost-intelligence/ + + - name: Best Practice Check Definitions + description: Cost Intelligence - Best Practice Check Definitions + 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: + - Best Practice Check Assessments + - Best Practice Check Definitions + - Best Practice Checks paths: /aws/ec2/group: @@ -970,4 +990,20 @@ paths: $ref: services/beci/setup/paths/cloudBillingV1SetupAccount.yaml /cloudBilling/v1/setup/account/validation: $ref: services/beci/setup/paths/cloudBillingV1SetupAccountValidation.yaml + /cbi/v1/bestPractice/assessment: + $ref: services/beci/bestPractice/paths/cbiV1BestPracticeAssessment.yaml + /cbi/v1/bestPractice/assessment/{assessmentId}/check: + $ref: services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheck.yaml + /cbi/v1/bestPractice/assessment/{assessmentId}/summary: + $ref: services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdSummary.yaml + /cbi/v1/bestPractice/assessment/{assessmentId}/check/{checkId}: + $ref: services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheckId.yaml + /cbi/v1/bestPractice/assessment/{assessmentId}/check/{checkId}/summary: + $ref: services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheckIdSummary.yaml + /cbi/v1/bestPractice/assessment/{assessmentId}/property/{propertyName}/value: + $ref: services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdPropertyIdValue.yaml + /cbi/v1/bestPractice/assessment/{assessmentId}/check/{checkId}/property/{propertyName}/value: + $ref: services/beci/bestPractice/paths/cbiV1BestPracticeAssessmentIdCheckIdPropertyIdValue.yaml + /cbi/v1/bestPractice/checkDefinition/{checkId}: + $ref: services/beci/bestPractice/paths/cbiV1BestPracticeCheckDefinitionId.yaml #