From 7bd6dc1df6399016f2b6f13773b4638daf40359f Mon Sep 17 00:00:00 2001 From: orsh1 <114858621+orsh1@users.noreply.github.com> Date: Sun, 8 Dec 2024 15:33:33 +0200 Subject: [PATCH 1/6] AWSEG-29608 - Remove "spectrum" option from elastigroup scaling (#684) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove "spectrum" option from elastigroup scaling * revert gcp change --------- Co-authored-by: orsh1 <“oshilian@netapp.com”> --- .../elastigroup/aws/schemas/elastigroupScaleDown.yaml | 4 ++-- api/services/elastigroup/aws/schemas/elastigroupScaleUp.yaml | 4 ++-- .../elastigroup/aws/schemas/elastigroupTargetScale.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/services/elastigroup/aws/schemas/elastigroupScaleDown.yaml b/api/services/elastigroup/aws/schemas/elastigroupScaleDown.yaml index 4d05cb61a..e7fc59f60 100644 --- a/api/services/elastigroup/aws/schemas/elastigroupScaleDown.yaml +++ b/api/services/elastigroup/aws/schemas/elastigroupScaleDown.yaml @@ -15,8 +15,8 @@ properties: type: string description: | The metric source. - enum: [ spectrum, cloudWatch ] - example: "spectrum" + enum: [ cloudWatch ] + example: "cloudWatch" metricName: type: string description: | diff --git a/api/services/elastigroup/aws/schemas/elastigroupScaleUp.yaml b/api/services/elastigroup/aws/schemas/elastigroupScaleUp.yaml index 5087cebab..4dceb0ef8 100644 --- a/api/services/elastigroup/aws/schemas/elastigroupScaleUp.yaml +++ b/api/services/elastigroup/aws/schemas/elastigroupScaleUp.yaml @@ -18,8 +18,8 @@ properties: type: string description: | The metric source. - enum: [ spectrum, cloudWatch ] - example: "spectrum" + enum: [ cloudWatch ] + example: "cloudWatch" metricName: type: string description: | diff --git a/api/services/elastigroup/aws/schemas/elastigroupTargetScale.yaml b/api/services/elastigroup/aws/schemas/elastigroupTargetScale.yaml index 38cb8c205..2ac5c294c 100644 --- a/api/services/elastigroup/aws/schemas/elastigroupTargetScale.yaml +++ b/api/services/elastigroup/aws/schemas/elastigroupTargetScale.yaml @@ -10,9 +10,9 @@ properties: title: Source description: | The source of the metric. - enum: [ cloudWatch, spectrum ] + enum: [ cloudWatch ] type: string - example: "spectrum" + example: "cloudWatch" policyName: type: string description: | From 0f3ec1421de8100c64949d71f9cb7f9336fec32c Mon Sep 17 00:00:00 2001 From: noasaunders219 <117283483+noasaunders219@users.noreply.github.com> Date: Sun, 8 Dec 2024 17:00:17 +0200 Subject: [PATCH 2/6] Con 31930 openapi (#686) * added scheduling * added scheduling * added scheduling to vng template --------- Co-authored-by: yardenE <41858765+yardenE@users.noreply.github.com> --- .../create/ocean-virtualNodeGroup.yaml | 4 +++- .../ocean-virtualNodeGroupTemplate.yaml | 2 ++ .../aks/schemas/ocean-virtualNodeGroup.yaml | 2 ++ .../schemas/virtualNodeGroup-scheduling.yaml | 23 +++++++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 api/services/ocean/aks/schemas/virtualNodeGroup-scheduling.yaml diff --git a/api/services/ocean/aks/schemas/create/ocean-virtualNodeGroup.yaml b/api/services/ocean/aks/schemas/create/ocean-virtualNodeGroup.yaml index e47e9ad32..2c72f2479 100644 --- a/api/services/ocean/aks/schemas/create/ocean-virtualNodeGroup.yaml +++ b/api/services/ocean/aks/schemas/create/ocean-virtualNodeGroup.yaml @@ -91,4 +91,6 @@ properties: description: | A maximum of 10 unique key-value pairs for VM tags in the virtual node group. vmSizes: - $ref: "../../schemas/ocean-vmSizes.yaml" \ No newline at end of file + $ref: "../../schemas/ocean-vmSizes.yaml" + scheduling: + $ref: "../../schemas/virtualNodeGroup-scheduling.yaml" \ No newline at end of file diff --git a/api/services/ocean/aks/schemas/create/ocean-virtualNodeGroupTemplate.yaml b/api/services/ocean/aks/schemas/create/ocean-virtualNodeGroupTemplate.yaml index c50dd1d58..ea4a0ba84 100644 --- a/api/services/ocean/aks/schemas/create/ocean-virtualNodeGroupTemplate.yaml +++ b/api/services/ocean/aks/schemas/create/ocean-virtualNodeGroupTemplate.yaml @@ -81,3 +81,5 @@ properties: A maximum of 10 unique key-value pairs for VM tags in the virtual node group. vmSizes: $ref: "../../schemas/ocean-vmSizes.yaml" + scheduling: + $ref: "../../schemas/virtualNodeGroup-scheduling.yaml" diff --git a/api/services/ocean/aks/schemas/ocean-virtualNodeGroup.yaml b/api/services/ocean/aks/schemas/ocean-virtualNodeGroup.yaml index e0b0f46c3..dd82ed2dd 100644 --- a/api/services/ocean/aks/schemas/ocean-virtualNodeGroup.yaml +++ b/api/services/ocean/aks/schemas/ocean-virtualNodeGroup.yaml @@ -93,6 +93,8 @@ properties: A maximum of 10 unique key-value pairs for VM tags in the virtual node group. vmSizes: $ref: "../schemas/ocean-vmSizes.yaml" + scheduling: + $ref: "../schemas/virtualNodeGroup-scheduling.yaml" createdAt: type: string readOnly: true diff --git a/api/services/ocean/aks/schemas/virtualNodeGroup-scheduling.yaml b/api/services/ocean/aks/schemas/virtualNodeGroup-scheduling.yaml new file mode 100644 index 000000000..d3bbbe889 --- /dev/null +++ b/api/services/ocean/aks/schemas/virtualNodeGroup-scheduling.yaml @@ -0,0 +1,23 @@ +type: object +description: > + An object used to specify times when the virtual node group will turn off all its node pools. Once the shutdown time will be over, the virtual node group will return to its previous state. +title: Ocean VNG AKS Scheduling +properties: + shutdownHours: + type: object + description: > + An object used to specify times that the nodes in the virtual node group will be stopped. + title: Shutdown Hours + properties: + timeWindows: + type: array + description: > + The times that the shutdown hours will apply. Required if isEnabled is true. + items: + type: string + example: "Sat:08:00-Sun:08:00" + isEnabled: + type: boolean + example: true + description: > + Flag to enable or disable the shutdown hours mechanism. When False, the mechanism is deactivated, and the virtual node gorup remains in its current state. \ No newline at end of file From bc7d950d7187363c03a6aa346891106b55b836d4 Mon Sep 17 00:00:00 2001 From: Avinash Bharti Date: Tue, 10 Dec 2024 12:41:30 +0530 Subject: [PATCH 3/6] Add Docs For secops rest apis (#687) * added: changes for spot security public rest api's * added: fix for breaking PR validations * updated: docs as per feedback * fix: updated schema to match with finops standards * updated: removed some of the unused files * fix * updated: schema for null removal * fix * added venv to gitignore * added: fix --------- Co-authored-by: Avinash Bharti --- .gitignore | 1 + .../v1/parameters/accountId_query.yaml | 10 +++ .../v1/parameters/accountName_query.yaml | 8 +++ .../security/v1/parameters/assetId_query.yaml | 8 +++ .../v1/parameters/assetType_query.yaml | 8 +++ .../security/v1/parameters/cloud_query.yaml | 5 ++ .../v1/parameters/complianceName_path.yaml | 9 +++ .../v1/parameters/complianceName_query.yaml | 9 +++ .../v1/parameters/controlId_query.yaml | 9 +++ .../security/v1/parameters/date_query.yaml | 10 +++ .../v1/parameters/isAutomated_query.yaml | 8 +++ .../v1/parameters/notAccountId_query.yaml | 10 +++ .../v1/parameters/notAccountName_query.yaml | 8 +++ .../v1/parameters/notAssetType_query.yaml | 8 +++ .../v1/parameters/notRegion_query.yaml | 9 +++ .../v1/parameters/notService_query.yaml | 8 +++ .../v1/parameters/paginationKey_query.yaml | 8 +++ .../v1/parameters/paginationSize_query.yaml | 11 ++++ .../security/v1/parameters/region_query.yaml | 9 +++ .../v1/parameters/ruleName_query.yaml | 8 +++ .../security/v1/parameters/service_query.yaml | 8 +++ .../security/v1/paths/compliances.yaml | 33 ++++++++++ api/services/security/v1/paths/controls.yaml | 36 +++++++++++ .../security/v1/paths/controls_count.yaml | 28 ++++++++ api/services/security/v1/paths/count.yaml | 20 ++++++ .../security/v1/paths/misconfigurations.yaml | 42 ++++++++++++ .../v1/paths/misconfigurations_count.yaml | 40 ++++++++++++ api/services/security/v1/paths/rules.yaml | 38 +++++++++++ .../security/v1/paths/rules_count.yaml | 36 +++++++++++ .../v1/schemas/BaseResponse_CountModel_.yaml | 20 ++++++ .../security/v1/schemas/ComplianceModel.yaml | 6 ++ .../security/v1/schemas/ControlModel.yaml | 12 ++++ .../security/v1/schemas/CountModel.yaml | 9 +++ api/services/security/v1/schemas/Effort.yaml | 7 ++ .../security/v1/schemas/ErrorModel.yaml | 12 ++++ .../v1/schemas/HTTPValidationError.yaml | 8 +++ .../v1/schemas/MisconfigurationModel.yaml | 21 ++++++ .../v1/schemas/MisconfigurationWhatModel.yaml | 43 +++++++++++++ .../v1/schemas/MisconfigurationWhenModel.yaml | 15 +++++ .../schemas/MisconfigurationWhereModel.yaml | 42 ++++++++++++ .../v1/schemas/MisconfigurationWhoModel.yaml | 9 +++ .../PaginatedResponse_ComplianceModel_.yaml | 23 +++++++ .../PaginatedResponse_ControlModel_.yaml | 23 +++++++ ...inatedResponse_MisconfigurationModel_.yaml | 23 +++++++ .../PaginatedResponse_RulesModel_.yaml | 23 +++++++ .../security/v1/schemas/PaginationModel.yaml | 18 ++++++ .../security/v1/schemas/RequestModel.yaml | 28 ++++++++ .../security/v1/schemas/RulesModel.yaml | 64 +++++++++++++++++++ .../security/v1/schemas/Severity.yaml | 7 ++ ...potResponse_BaseResponse_CountModel__.yaml | 17 +++++ ...e_PaginatedResponse_ComplianceModel__.yaml | 17 +++++ ...onse_PaginatedResponse_ControlModel__.yaml | 17 +++++ ...natedResponse_MisconfigurationModel__.yaml | 17 +++++ ...sponse_PaginatedResponse_RulesModel__.yaml | 17 +++++ .../security/v1/schemas/StatusModel.yaml | 12 ++++ .../security/v1/schemas/ValidationError.yaml | 20 ++++++ .../cloud__constant__base__CloudProvider.yaml | 6 ++ .../databases__constant__CloudProvider.yaml | 6 ++ api/spot.yaml | 22 ++++++- 59 files changed, 1008 insertions(+), 1 deletion(-) create mode 100644 api/services/security/v1/parameters/accountId_query.yaml create mode 100644 api/services/security/v1/parameters/accountName_query.yaml create mode 100644 api/services/security/v1/parameters/assetId_query.yaml create mode 100644 api/services/security/v1/parameters/assetType_query.yaml create mode 100644 api/services/security/v1/parameters/cloud_query.yaml create mode 100644 api/services/security/v1/parameters/complianceName_path.yaml create mode 100644 api/services/security/v1/parameters/complianceName_query.yaml create mode 100644 api/services/security/v1/parameters/controlId_query.yaml create mode 100644 api/services/security/v1/parameters/date_query.yaml create mode 100644 api/services/security/v1/parameters/isAutomated_query.yaml create mode 100644 api/services/security/v1/parameters/notAccountId_query.yaml create mode 100644 api/services/security/v1/parameters/notAccountName_query.yaml create mode 100644 api/services/security/v1/parameters/notAssetType_query.yaml create mode 100644 api/services/security/v1/parameters/notRegion_query.yaml create mode 100644 api/services/security/v1/parameters/notService_query.yaml create mode 100644 api/services/security/v1/parameters/paginationKey_query.yaml create mode 100644 api/services/security/v1/parameters/paginationSize_query.yaml create mode 100644 api/services/security/v1/parameters/region_query.yaml create mode 100644 api/services/security/v1/parameters/ruleName_query.yaml create mode 100644 api/services/security/v1/parameters/service_query.yaml create mode 100644 api/services/security/v1/paths/compliances.yaml create mode 100644 api/services/security/v1/paths/controls.yaml create mode 100644 api/services/security/v1/paths/controls_count.yaml create mode 100644 api/services/security/v1/paths/count.yaml create mode 100644 api/services/security/v1/paths/misconfigurations.yaml create mode 100644 api/services/security/v1/paths/misconfigurations_count.yaml create mode 100644 api/services/security/v1/paths/rules.yaml create mode 100644 api/services/security/v1/paths/rules_count.yaml create mode 100644 api/services/security/v1/schemas/BaseResponse_CountModel_.yaml create mode 100644 api/services/security/v1/schemas/ComplianceModel.yaml create mode 100644 api/services/security/v1/schemas/ControlModel.yaml create mode 100644 api/services/security/v1/schemas/CountModel.yaml create mode 100644 api/services/security/v1/schemas/Effort.yaml create mode 100644 api/services/security/v1/schemas/ErrorModel.yaml create mode 100644 api/services/security/v1/schemas/HTTPValidationError.yaml create mode 100644 api/services/security/v1/schemas/MisconfigurationModel.yaml create mode 100644 api/services/security/v1/schemas/MisconfigurationWhatModel.yaml create mode 100644 api/services/security/v1/schemas/MisconfigurationWhenModel.yaml create mode 100644 api/services/security/v1/schemas/MisconfigurationWhereModel.yaml create mode 100644 api/services/security/v1/schemas/MisconfigurationWhoModel.yaml create mode 100644 api/services/security/v1/schemas/PaginatedResponse_ComplianceModel_.yaml create mode 100644 api/services/security/v1/schemas/PaginatedResponse_ControlModel_.yaml create mode 100644 api/services/security/v1/schemas/PaginatedResponse_MisconfigurationModel_.yaml create mode 100644 api/services/security/v1/schemas/PaginatedResponse_RulesModel_.yaml create mode 100644 api/services/security/v1/schemas/PaginationModel.yaml create mode 100644 api/services/security/v1/schemas/RequestModel.yaml create mode 100644 api/services/security/v1/schemas/RulesModel.yaml create mode 100644 api/services/security/v1/schemas/Severity.yaml create mode 100644 api/services/security/v1/schemas/SpotResponse_BaseResponse_CountModel__.yaml create mode 100644 api/services/security/v1/schemas/SpotResponse_PaginatedResponse_ComplianceModel__.yaml create mode 100644 api/services/security/v1/schemas/SpotResponse_PaginatedResponse_ControlModel__.yaml create mode 100644 api/services/security/v1/schemas/SpotResponse_PaginatedResponse_MisconfigurationModel__.yaml create mode 100644 api/services/security/v1/schemas/SpotResponse_PaginatedResponse_RulesModel__.yaml create mode 100644 api/services/security/v1/schemas/StatusModel.yaml create mode 100644 api/services/security/v1/schemas/ValidationError.yaml create mode 100644 api/services/security/v1/schemas/cloud__constant__base__CloudProvider.yaml create mode 100644 api/services/security/v1/schemas/databases__constant__CloudProvider.yaml diff --git a/.gitignore b/.gitignore index 34885fda0..94a19870c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ test-results.xml *.log* npm-debug.log package-lock.json +.venv/ \ No newline at end of file diff --git a/api/services/security/v1/parameters/accountId_query.yaml b/api/services/security/v1/parameters/accountId_query.yaml new file mode 100644 index 000000000..95c6d945b --- /dev/null +++ b/api/services/security/v1/parameters/accountId_query.yaml @@ -0,0 +1,10 @@ +description: A comma-separated list of cloud account IDs. For AWS this is the account + ID. For Azure, this is the subscription ID. +in: query +name: accountId +required: false +schema: + description: A comma-separated list of cloud account IDs. For AWS this is the account + ID. For Azure, this is the subscription ID. + title: Accountid + type: string diff --git a/api/services/security/v1/parameters/accountName_query.yaml b/api/services/security/v1/parameters/accountName_query.yaml new file mode 100644 index 000000000..6543f7b10 --- /dev/null +++ b/api/services/security/v1/parameters/accountName_query.yaml @@ -0,0 +1,8 @@ +description: A comma-separated list of cloud account names. +in: query +name: accountName +required: false +schema: + description: A comma-separated list of cloud account names. + title: Accountname + type: string diff --git a/api/services/security/v1/parameters/assetId_query.yaml b/api/services/security/v1/parameters/assetId_query.yaml new file mode 100644 index 000000000..d705a0dea --- /dev/null +++ b/api/services/security/v1/parameters/assetId_query.yaml @@ -0,0 +1,8 @@ +description: The asset's ID (a cloud resource). +in: query +name: assetId +required: false +schema: + description: The asset's ID (a cloud resource). + title: Assetid + type: string diff --git a/api/services/security/v1/parameters/assetType_query.yaml b/api/services/security/v1/parameters/assetType_query.yaml new file mode 100644 index 000000000..774f9e65d --- /dev/null +++ b/api/services/security/v1/parameters/assetType_query.yaml @@ -0,0 +1,8 @@ +description: A comma-separated list of cloud resources for the service. +in: query +name: assetType +required: false +schema: + description: A comma-separated list of cloud resources for the service. + title: Assettype + type: string diff --git a/api/services/security/v1/parameters/cloud_query.yaml b/api/services/security/v1/parameters/cloud_query.yaml new file mode 100644 index 000000000..b6c27b7ca --- /dev/null +++ b/api/services/security/v1/parameters/cloud_query.yaml @@ -0,0 +1,5 @@ +in: query +name: cloud +required: true +schema: + $ref: "../schemas/cloud__constant__base__CloudProvider.yaml" diff --git a/api/services/security/v1/parameters/complianceName_path.yaml b/api/services/security/v1/parameters/complianceName_path.yaml new file mode 100644 index 000000000..d89491246 --- /dev/null +++ b/api/services/security/v1/parameters/complianceName_path.yaml @@ -0,0 +1,9 @@ +description: The name of the cyber security compliance. +example: SOC_2 +in: path +name: complianceName +required: true +schema: + description: The name of the cyber security compliance. + title: Compliancename + type: string diff --git a/api/services/security/v1/parameters/complianceName_query.yaml b/api/services/security/v1/parameters/complianceName_query.yaml new file mode 100644 index 000000000..ac8c6c4db --- /dev/null +++ b/api/services/security/v1/parameters/complianceName_query.yaml @@ -0,0 +1,9 @@ +description: The name of the cyber security compliance. +example: SOC_2 +in: query +name: complianceName +required: false +schema: + description: The name of the cyber security compliance. + title: Compliancename + type: string diff --git a/api/services/security/v1/parameters/controlId_query.yaml b/api/services/security/v1/parameters/controlId_query.yaml new file mode 100644 index 000000000..f48461404 --- /dev/null +++ b/api/services/security/v1/parameters/controlId_query.yaml @@ -0,0 +1,9 @@ +description: The ID of the control defined in the compliance. +example: A1.2 +in: query +name: controlId +required: false +schema: + description: The ID of the control defined in the compliance. + title: Controlid + type: string diff --git a/api/services/security/v1/parameters/date_query.yaml b/api/services/security/v1/parameters/date_query.yaml new file mode 100644 index 000000000..26b8c74c7 --- /dev/null +++ b/api/services/security/v1/parameters/date_query.yaml @@ -0,0 +1,10 @@ +description: The date the finding was most recently found (YYYY-MM-DD). +example: '1997-11-11' +in: query +name: date +required: false +schema: + description: The date the finding was most recently found (YYYY-MM-DD). + format: date + title: Date + type: string diff --git a/api/services/security/v1/parameters/isAutomated_query.yaml b/api/services/security/v1/parameters/isAutomated_query.yaml new file mode 100644 index 000000000..9bee385b1 --- /dev/null +++ b/api/services/security/v1/parameters/isAutomated_query.yaml @@ -0,0 +1,8 @@ +description: If this is not a manual control, the value is True. +in: query +name: isAutomated +required: false +schema: + description: If this is not a manual control, the value is True. + title: Isautomated + type: boolean diff --git a/api/services/security/v1/parameters/notAccountId_query.yaml b/api/services/security/v1/parameters/notAccountId_query.yaml new file mode 100644 index 000000000..abaef797e --- /dev/null +++ b/api/services/security/v1/parameters/notAccountId_query.yaml @@ -0,0 +1,10 @@ +description: A comma-separated list of cloud account IDs to exclude. For AWS this + is the account ID. For Azure, this is the subscription ID. +in: query +name: notAccountId +required: false +schema: + description: A comma-separated list of cloud account IDs to exclude. For AWS this + is the account ID. For Azure, this is the subscription ID. + title: Notaccountid + type: string diff --git a/api/services/security/v1/parameters/notAccountName_query.yaml b/api/services/security/v1/parameters/notAccountName_query.yaml new file mode 100644 index 000000000..2add4be0c --- /dev/null +++ b/api/services/security/v1/parameters/notAccountName_query.yaml @@ -0,0 +1,8 @@ +description: A comma-separated list of cloud account names to exclude +in: query +name: notAccountName +required: false +schema: + description: A comma-separated list of cloud account names to exclude + title: Notaccountname + type: string diff --git a/api/services/security/v1/parameters/notAssetType_query.yaml b/api/services/security/v1/parameters/notAssetType_query.yaml new file mode 100644 index 000000000..e661ebd10 --- /dev/null +++ b/api/services/security/v1/parameters/notAssetType_query.yaml @@ -0,0 +1,8 @@ +description: A comma-separated list of cloud resources for the service to exclude. +in: query +name: notAssetType +required: false +schema: + description: A comma-separated list of cloud resources for the service to exclude. + title: Notassettype + type: string diff --git a/api/services/security/v1/parameters/notRegion_query.yaml b/api/services/security/v1/parameters/notRegion_query.yaml new file mode 100644 index 000000000..8834aa51c --- /dev/null +++ b/api/services/security/v1/parameters/notRegion_query.yaml @@ -0,0 +1,9 @@ +description: A comma-separated list of cloud regions to exclude. +example: us-east-1 +in: query +name: notRegion +required: false +schema: + description: A comma-separated list of cloud regions to exclude. + title: Notregion + type: string diff --git a/api/services/security/v1/parameters/notService_query.yaml b/api/services/security/v1/parameters/notService_query.yaml new file mode 100644 index 000000000..4523f2ee5 --- /dev/null +++ b/api/services/security/v1/parameters/notService_query.yaml @@ -0,0 +1,8 @@ +description: A comma-separated list of cloud services to exclude. +in: query +name: notService +required: false +schema: + description: A comma-separated list of cloud services to exclude. + title: Notservice + type: string diff --git a/api/services/security/v1/parameters/paginationKey_query.yaml b/api/services/security/v1/parameters/paginationKey_query.yaml new file mode 100644 index 000000000..6a187a9cd --- /dev/null +++ b/api/services/security/v1/parameters/paginationKey_query.yaml @@ -0,0 +1,8 @@ +description: Token of the page to return. +in: query +name: paginationKey +required: false +schema: + description: Token of the page to return. + title: Paginationkey + type: string diff --git a/api/services/security/v1/parameters/paginationSize_query.yaml b/api/services/security/v1/parameters/paginationSize_query.yaml new file mode 100644 index 000000000..e0f2aa8ca --- /dev/null +++ b/api/services/security/v1/parameters/paginationSize_query.yaml @@ -0,0 +1,11 @@ +description: Number of items to return per page. +in: query +name: paginationSize +required: false +schema: + default: 100 + description: Number of items to return per page. + maximum: 100 + minimum: 1 + title: Paginationsize + type: integer diff --git a/api/services/security/v1/parameters/region_query.yaml b/api/services/security/v1/parameters/region_query.yaml new file mode 100644 index 000000000..0178cd687 --- /dev/null +++ b/api/services/security/v1/parameters/region_query.yaml @@ -0,0 +1,9 @@ +description: A comma-separated list of cloud regions. +example: us-east-1 +in: query +name: region +required: false +schema: + description: A comma-separated list of cloud regions. + title: Region + type: string diff --git a/api/services/security/v1/parameters/ruleName_query.yaml b/api/services/security/v1/parameters/ruleName_query.yaml new file mode 100644 index 000000000..22b3a4ec5 --- /dev/null +++ b/api/services/security/v1/parameters/ruleName_query.yaml @@ -0,0 +1,8 @@ +description: The unique name of the rule. +in: query +name: ruleName +required: false +schema: + description: The unique name of the rule. + title: Rulename + type: string diff --git a/api/services/security/v1/parameters/service_query.yaml b/api/services/security/v1/parameters/service_query.yaml new file mode 100644 index 000000000..1c67e9cc4 --- /dev/null +++ b/api/services/security/v1/parameters/service_query.yaml @@ -0,0 +1,8 @@ +description: A comma-separated list of cloud services. +in: query +name: service +required: false +schema: + description: A comma-separated list of cloud services. + title: Service + type: string diff --git a/api/services/security/v1/paths/compliances.yaml b/api/services/security/v1/paths/compliances.yaml new file mode 100644 index 000000000..dc46c272f --- /dev/null +++ b/api/services/security/v1/paths/compliances.yaml @@ -0,0 +1,33 @@ +get: + description: 'A cyber security compliance determines how compliant an asset is. + It checks against specific security standards. + + This API returns list of all compliances supported in Spot. + + A compliance consists of one or more controls.' + operationId: get_compliances_v1_compliances_get + parameters: + - $ref: "../parameters/paginationKey_query.yaml" + - $ref: "../parameters/paginationSize_query.yaml" + responses: + '200': + content: + application/json: + schema: + $ref: "../schemas/SpotResponse_PaginatedResponse_ComplianceModel__.yaml" + description: Successful Response + '400': + content: {} + description: Bad Request + '404': + description: Not Found + '422': + content: + application/json: + schema: + $ref: "../schemas/HTTPValidationError.yaml" + description: Validation Error + summary: Get Compliances + tags: + - Compliance +parameters: [] diff --git a/api/services/security/v1/paths/controls.yaml b/api/services/security/v1/paths/controls.yaml new file mode 100644 index 000000000..be01a8ebc --- /dev/null +++ b/api/services/security/v1/paths/controls.yaml @@ -0,0 +1,36 @@ +get: + description: 'A control is countermeasures to avoid, detect, counteract, or minimize + security risks of cloud assets. + + A control may be part of one or more compliances. A control is verified in one + or more rules. + + This API returns the list of controls mapped to a specific compliance.' + operationId: get_compliance_controls_v1_compliances__complianceName__controls_get + parameters: + - $ref: "../parameters/complianceName_path.yaml" + - $ref: "../parameters/isAutomated_query.yaml" + - $ref: "../parameters/paginationKey_query.yaml" + - $ref: "../parameters/paginationSize_query.yaml" + responses: + '200': + content: + application/json: + schema: + $ref: "../schemas/SpotResponse_PaginatedResponse_ControlModel__.yaml" + description: Successful Response + '400': + content: {} + description: Bad Request + '404': + description: Not Found + '422': + content: + application/json: + schema: + $ref: "../schemas/HTTPValidationError.yaml" + description: Validation Error + summary: Get Compliance Controls + tags: + - Compliance +parameters: [] diff --git a/api/services/security/v1/paths/controls_count.yaml b/api/services/security/v1/paths/controls_count.yaml new file mode 100644 index 000000000..49596589f --- /dev/null +++ b/api/services/security/v1/paths/controls_count.yaml @@ -0,0 +1,28 @@ +get: + description: Get the total number of controls for the selected compliance. + operationId: get_compliance_controls_count_v1_compliances__complianceName__controls_count_get + parameters: + - $ref: "../parameters/complianceName_path.yaml" + - $ref: "../parameters/isAutomated_query.yaml" + responses: + '200': + content: + application/json: + schema: + $ref: "../schemas/SpotResponse_BaseResponse_CountModel__.yaml" + description: Successful Response + '400': + content: {} + description: Bad Request + '404': + description: Not Found + '422': + content: + application/json: + schema: + $ref: "../schemas/HTTPValidationError.yaml" + description: Validation Error + summary: Get Compliance Controls Count + tags: + - Compliance +parameters: [] diff --git a/api/services/security/v1/paths/count.yaml b/api/services/security/v1/paths/count.yaml new file mode 100644 index 000000000..e86d21cdd --- /dev/null +++ b/api/services/security/v1/paths/count.yaml @@ -0,0 +1,20 @@ +get: + description: Get the total number of compliances. + operationId: get_compliance_count_v1_compliances_count_get + parameters: [] + responses: + '200': + content: + application/json: + schema: + $ref: "../schemas/SpotResponse_BaseResponse_CountModel__.yaml" + description: Successful Response + '400': + content: {} + description: Bad Request + '404': + description: Not Found + summary: Get Compliance Count + tags: + - Compliance +parameters: [] diff --git a/api/services/security/v1/paths/misconfigurations.yaml b/api/services/security/v1/paths/misconfigurations.yaml new file mode 100644 index 000000000..cb2f88ad4 --- /dev/null +++ b/api/services/security/v1/paths/misconfigurations.yaml @@ -0,0 +1,42 @@ +get: + description: This API returns the list of assets that have misconfigurations. + operationId: get_misconfigurations_v1_misconfigurations_get + parameters: + - $ref: "../parameters/cloud_query.yaml" + - $ref: "../parameters/accountId_query.yaml" + - $ref: "../parameters/notAccountId_query.yaml" + - $ref: "../parameters/accountName_query.yaml" + - $ref: "../parameters/notAccountName_query.yaml" + - $ref: "../parameters/region_query.yaml" + - $ref: "../parameters/notRegion_query.yaml" + - $ref: "../parameters/date_query.yaml" + - $ref: "../parameters/service_query.yaml" + - $ref: "../parameters/notService_query.yaml" + - $ref: "../parameters/assetType_query.yaml" + - $ref: "../parameters/notAssetType_query.yaml" + - $ref: "../parameters/ruleName_query.yaml" + - $ref: "../parameters/assetId_query.yaml" + - $ref: "../parameters/paginationKey_query.yaml" + - $ref: "../parameters/paginationSize_query.yaml" + responses: + '200': + content: + application/json: + schema: + $ref: "../schemas/SpotResponse_PaginatedResponse_MisconfigurationModel__.yaml" + description: Successful Response + '400': + content: {} + description: Bad Request + '404': + description: Not Found + '422': + content: + application/json: + schema: + $ref: "../schemas/HTTPValidationError.yaml" + description: Validation Error + summary: Get Misconfigurations + tags: + - Misconfiguration +parameters: [] diff --git a/api/services/security/v1/paths/misconfigurations_count.yaml b/api/services/security/v1/paths/misconfigurations_count.yaml new file mode 100644 index 000000000..2ab651c62 --- /dev/null +++ b/api/services/security/v1/paths/misconfigurations_count.yaml @@ -0,0 +1,40 @@ +get: + description: This API returns a count of assets that have misconfigurations. + operationId: get_misconfigurations_count_v1_misconfigurations_count_get + parameters: + - $ref: "../parameters/cloud_query.yaml" + - $ref: "../parameters/accountId_query.yaml" + - $ref: "../parameters/notAccountId_query.yaml" + - $ref: "../parameters/accountName_query.yaml" + - $ref: "../parameters/notAccountName_query.yaml" + - $ref: "../parameters/region_query.yaml" + - $ref: "../parameters/notRegion_query.yaml" + - $ref: "../parameters/date_query.yaml" + - $ref: "../parameters/service_query.yaml" + - $ref: "../parameters/notService_query.yaml" + - $ref: "../parameters/assetType_query.yaml" + - $ref: "../parameters/notAssetType_query.yaml" + - $ref: "../parameters/ruleName_query.yaml" + - $ref: "../parameters/assetId_query.yaml" + responses: + '200': + content: + application/json: + schema: + $ref: "../schemas/SpotResponse_BaseResponse_CountModel__.yaml" + description: Successful Response + '400': + content: {} + description: Bad Request + '404': + description: Not Found + '422': + content: + application/json: + schema: + $ref: "../schemas/HTTPValidationError.yaml" + description: Validation Error + summary: Get Misconfigurations Count + tags: + - Misconfiguration +parameters: [] diff --git a/api/services/security/v1/paths/rules.yaml b/api/services/security/v1/paths/rules.yaml new file mode 100644 index 000000000..691b28f10 --- /dev/null +++ b/api/services/security/v1/paths/rules.yaml @@ -0,0 +1,38 @@ +get: + description: 'Rules are configuration checks that detect misconfigurations in your + cloud environment. + + Rules are cloud service provider specific. A rule is mapped to one or more controls. + + This API returns the list of rules that can determine the state of a specific + control.' + operationId: get_rules_v1_misconfigurations_rules_get + parameters: + - $ref: "../parameters/cloud_query.yaml" + - $ref: "../parameters/complianceName_query.yaml" + - $ref: "../parameters/controlId_query.yaml" + - $ref: "../parameters/service_query.yaml" + - $ref: "../parameters/paginationKey_query.yaml" + - $ref: "../parameters/paginationSize_query.yaml" + responses: + '200': + content: + application/json: + schema: + $ref: "../schemas/SpotResponse_PaginatedResponse_RulesModel__.yaml" + description: Successful Response + '400': + content: {} + description: Bad Request + '404': + description: Not Found + '422': + content: + application/json: + schema: + $ref: "../schemas/HTTPValidationError.yaml" + description: Validation Error + summary: Get Rules + tags: + - Misconfiguration +parameters: [] diff --git a/api/services/security/v1/paths/rules_count.yaml b/api/services/security/v1/paths/rules_count.yaml new file mode 100644 index 000000000..6f0802a1b --- /dev/null +++ b/api/services/security/v1/paths/rules_count.yaml @@ -0,0 +1,36 @@ +get: + description: 'Rules are configuration checks that detect misconfigurations in your + cloud environment. + + Rules are cloud service provider specific. A rule is mapped to one or more controls. + + This API returns the list of rules that can determine the state of a specific + control.' + operationId: get_rules_count_v1_misconfigurations_rules_count_get + parameters: + - $ref: "../parameters/cloud_query.yaml" + - $ref: "../parameters/complianceName_query.yaml" + - $ref: "../parameters/controlId_query.yaml" + - $ref: "../parameters/service_query.yaml" + responses: + '200': + content: + application/json: + schema: + $ref: "../schemas/SpotResponse_BaseResponse_CountModel__.yaml" + description: Successful Response + '400': + content: {} + description: Bad Request + '404': + description: Not Found + '422': + content: + application/json: + schema: + $ref: "../schemas/HTTPValidationError.yaml" + description: Validation Error + summary: Get Rules Count + tags: + - Misconfiguration +parameters: [] diff --git a/api/services/security/v1/schemas/BaseResponse_CountModel_.yaml b/api/services/security/v1/schemas/BaseResponse_CountModel_.yaml new file mode 100644 index 000000000..0f5824751 --- /dev/null +++ b/api/services/security/v1/schemas/BaseResponse_CountModel_.yaml @@ -0,0 +1,20 @@ +properties: + count: + default: 0 + description: The number of items. + title: Count + type: integer + items: + description: The array of objects in this response. The length of the array is + according to the 'count' attribute. + items: + $ref: ./CountModel.yaml + title: Items + type: array + status: + $ref: ./StatusModel.yaml +required: +- status +- items +title: BaseResponse[CountModel] +type: object diff --git a/api/services/security/v1/schemas/ComplianceModel.yaml b/api/services/security/v1/schemas/ComplianceModel.yaml new file mode 100644 index 000000000..7e647b06e --- /dev/null +++ b/api/services/security/v1/schemas/ComplianceModel.yaml @@ -0,0 +1,6 @@ +properties: + complianceName: + title: Compliancename + type: string +title: ComplianceModel +type: object diff --git a/api/services/security/v1/schemas/ControlModel.yaml b/api/services/security/v1/schemas/ControlModel.yaml new file mode 100644 index 000000000..3d69a5db9 --- /dev/null +++ b/api/services/security/v1/schemas/ControlModel.yaml @@ -0,0 +1,12 @@ +properties: + controlId: + title: Controlid + type: string + description: + title: Description + type: string + isAutomated: + title: Isautomated + type: boolean +title: ControlModel +type: object diff --git a/api/services/security/v1/schemas/CountModel.yaml b/api/services/security/v1/schemas/CountModel.yaml new file mode 100644 index 000000000..3cba435db --- /dev/null +++ b/api/services/security/v1/schemas/CountModel.yaml @@ -0,0 +1,9 @@ +properties: + value: + description: The number of items. + title: Value + type: integer +required: +- value +title: CountModel +type: object diff --git a/api/services/security/v1/schemas/Effort.yaml b/api/services/security/v1/schemas/Effort.yaml new file mode 100644 index 000000000..862936d22 --- /dev/null +++ b/api/services/security/v1/schemas/Effort.yaml @@ -0,0 +1,7 @@ +enum: +- High +- Medium +- Low +- '' +title: Effort +type: string diff --git a/api/services/security/v1/schemas/ErrorModel.yaml b/api/services/security/v1/schemas/ErrorModel.yaml new file mode 100644 index 000000000..4ae656126 --- /dev/null +++ b/api/services/security/v1/schemas/ErrorModel.yaml @@ -0,0 +1,12 @@ +properties: + code: + title: Code + type: string + message: + title: Message + type: string +required: +- code +- message +title: ErrorModel +type: object diff --git a/api/services/security/v1/schemas/HTTPValidationError.yaml b/api/services/security/v1/schemas/HTTPValidationError.yaml new file mode 100644 index 000000000..c788cb617 --- /dev/null +++ b/api/services/security/v1/schemas/HTTPValidationError.yaml @@ -0,0 +1,8 @@ +properties: + detail: + items: + $ref: ./ValidationError.yaml + title: Detail + type: array +title: HTTPValidationError +type: object diff --git a/api/services/security/v1/schemas/MisconfigurationModel.yaml b/api/services/security/v1/schemas/MisconfigurationModel.yaml new file mode 100644 index 000000000..c650dcb8b --- /dev/null +++ b/api/services/security/v1/schemas/MisconfigurationModel.yaml @@ -0,0 +1,21 @@ +properties: + organizationId: + description: The Spot Organization ID. + title: Organizationid + type: string + what: + $ref: ./MisconfigurationWhatModel.yaml + when: + $ref: ./MisconfigurationWhenModel.yaml + where: + $ref: ./MisconfigurationWhereModel.yaml + who: + $ref: ./MisconfigurationWhoModel.yaml +required: +- organizationId +- when +- what +- where +- who +title: MisconfigurationModel +type: object diff --git a/api/services/security/v1/schemas/MisconfigurationWhatModel.yaml b/api/services/security/v1/schemas/MisconfigurationWhatModel.yaml new file mode 100644 index 000000000..6e450b785 --- /dev/null +++ b/api/services/security/v1/schemas/MisconfigurationWhatModel.yaml @@ -0,0 +1,43 @@ +properties: + args: + description: 'Certain misconfiguration rules have arguments. This field contains + the arguments in the form of an comma separated array. Example: ["MongoDB", + "TCP", "27017"]' + items: + type: string + title: Args + type: array + isSuppressed: + description: If this finding is suppressed, the value is True. + title: Issuppressed + type: boolean + ruleDescription: + description: Description of the rule. + title: Ruledescription + type: string + ruleName: + description: The unique name of the rule. + title: Rulename + type: string + ruleTitle: + description: The name of the rule. + title: Ruletitle + type: string + severity: + description: The severity of the rule. + title: Severity + type: string + state: + description: The state of the misconfiguration. It is either open or closed. + title: State + type: string +required: +- ruleName +- ruleTitle +- ruleDescription +- args +- severity +- state +- isSuppressed +title: MisconfigurationWhatModel +type: object diff --git a/api/services/security/v1/schemas/MisconfigurationWhenModel.yaml b/api/services/security/v1/schemas/MisconfigurationWhenModel.yaml new file mode 100644 index 000000000..d16373d8a --- /dev/null +++ b/api/services/security/v1/schemas/MisconfigurationWhenModel.yaml @@ -0,0 +1,15 @@ +properties: + lastSeen: + description: The date the finding was most recently found (YYYY-MM-DD). + title: Lastseen + type: string + suppressedAt: + description: When the finding was suppressed. + format: date-time + title: Suppressedat + type: string +required: +- lastSeen +- suppressedAt +title: MisconfigurationWhenModel +type: object diff --git a/api/services/security/v1/schemas/MisconfigurationWhereModel.yaml b/api/services/security/v1/schemas/MisconfigurationWhereModel.yaml new file mode 100644 index 000000000..5e1873d10 --- /dev/null +++ b/api/services/security/v1/schemas/MisconfigurationWhereModel.yaml @@ -0,0 +1,42 @@ +properties: + accountId: + description: A comma-separated list of cloud account IDs. For AWS this is the + account ID. For Azure, this is the subscription ID. + title: Accountid + type: string + assetId: + description: The asset's ID (a cloud resource). + title: Assetid + type: string + assetName: + description: The name of the asset ID. + title: Assetname + type: string + assetType: + description: A comma-separated list of cloud resources for the service. + title: Assettype + type: string + findingLocation: + description: 'For a misconfiguration: the cloud resource or a subelement of the + cloud resource. For a vulnerability: the cloud resource, + an OS image, or a filename.' + title: Findinglocation + type: string + region: + description: A comma-separated list of cloud regions. + title: Region + type: string + service: + description: The cloud service. + title: Service + type: string +required: +- accountId +- service +- assetId +- assetName +- assetType +- region +- findingLocation +title: MisconfigurationWhereModel +type: object diff --git a/api/services/security/v1/schemas/MisconfigurationWhoModel.yaml b/api/services/security/v1/schemas/MisconfigurationWhoModel.yaml new file mode 100644 index 000000000..2cf6939f7 --- /dev/null +++ b/api/services/security/v1/schemas/MisconfigurationWhoModel.yaml @@ -0,0 +1,9 @@ +properties: + suppressedBy: + description: The user who suppressed the finding. + title: Suppressedby + type: string +required: +- suppressedBy +title: MisconfigurationWhoModel +type: object diff --git a/api/services/security/v1/schemas/PaginatedResponse_ComplianceModel_.yaml b/api/services/security/v1/schemas/PaginatedResponse_ComplianceModel_.yaml new file mode 100644 index 000000000..d43d8d19a --- /dev/null +++ b/api/services/security/v1/schemas/PaginatedResponse_ComplianceModel_.yaml @@ -0,0 +1,23 @@ +properties: + count: + default: 0 + description: The number of items. + title: Count + type: integer + items: + description: The array of objects in this response. The length of the array is + according to the 'count' attribute. + items: + $ref: ./ComplianceModel.yaml + title: Items + type: array + paginationInfo: + $ref: ./PaginationModel.yaml + status: + $ref: ./StatusModel.yaml +required: +- status +- items +- paginationInfo +title: PaginatedResponse[ComplianceModel] +type: object diff --git a/api/services/security/v1/schemas/PaginatedResponse_ControlModel_.yaml b/api/services/security/v1/schemas/PaginatedResponse_ControlModel_.yaml new file mode 100644 index 000000000..04b280b25 --- /dev/null +++ b/api/services/security/v1/schemas/PaginatedResponse_ControlModel_.yaml @@ -0,0 +1,23 @@ +properties: + count: + default: 0 + description: The number of items. + title: Count + type: integer + items: + description: The array of objects in this response. The length of the array is + according to the 'count' attribute. + items: + $ref: ./ControlModel.yaml + title: Items + type: array + paginationInfo: + $ref: ./PaginationModel.yaml + status: + $ref: ./StatusModel.yaml +required: +- status +- items +- paginationInfo +title: PaginatedResponse[ControlModel] +type: object diff --git a/api/services/security/v1/schemas/PaginatedResponse_MisconfigurationModel_.yaml b/api/services/security/v1/schemas/PaginatedResponse_MisconfigurationModel_.yaml new file mode 100644 index 000000000..9abdd2a7b --- /dev/null +++ b/api/services/security/v1/schemas/PaginatedResponse_MisconfigurationModel_.yaml @@ -0,0 +1,23 @@ +properties: + count: + default: 0 + description: The number of items. + title: Count + type: integer + items: + description: The array of objects in this response. The length of the array is + according to the 'count' attribute. + items: + $ref: ./MisconfigurationModel.yaml + title: Items + type: array + paginationInfo: + $ref: ./PaginationModel.yaml + status: + $ref: ./StatusModel.yaml +required: +- status +- items +- paginationInfo +title: PaginatedResponse[MisconfigurationModel] +type: object diff --git a/api/services/security/v1/schemas/PaginatedResponse_RulesModel_.yaml b/api/services/security/v1/schemas/PaginatedResponse_RulesModel_.yaml new file mode 100644 index 000000000..e60007f26 --- /dev/null +++ b/api/services/security/v1/schemas/PaginatedResponse_RulesModel_.yaml @@ -0,0 +1,23 @@ +properties: + count: + default: 0 + description: The number of items. + title: Count + type: integer + items: + description: The array of objects in this response. The length of the array is + according to the 'count' attribute. + items: + $ref: ./RulesModel.yaml + title: Items + type: array + paginationInfo: + $ref: ./PaginationModel.yaml + status: + $ref: ./StatusModel.yaml +required: +- status +- items +- paginationInfo +title: PaginatedResponse[RulesModel] +type: object diff --git a/api/services/security/v1/schemas/PaginationModel.yaml b/api/services/security/v1/schemas/PaginationModel.yaml new file mode 100644 index 000000000..497a899f3 --- /dev/null +++ b/api/services/security/v1/schemas/PaginationModel.yaml @@ -0,0 +1,18 @@ +properties: + nextKey: + description: Each API call has a unique token. This is the token for the next + page of results. + title: Nextkey + type: string + paginationSize: + description: The maximum number of items in the page. The attribute 'item' indicates + the actual number of items in the page. + title: Paginationsize + type: integer + previousKey: + description: Each API call has a unique token. This is the token for the previous + page of results. + title: Previouskey + type: string +title: PaginationModel +type: object diff --git a/api/services/security/v1/schemas/RequestModel.yaml b/api/services/security/v1/schemas/RequestModel.yaml new file mode 100644 index 000000000..7f7a8ccb3 --- /dev/null +++ b/api/services/security/v1/schemas/RequestModel.yaml @@ -0,0 +1,28 @@ +properties: + body: + title: Body + type: object + id: + title: Id + type: string + method: + title: Method + type: string + queryParameters: + title: Queryparameters + type: object + timestamp: + title: Timestamp + type: string + url: + title: Url + type: string +required: +- id +- url +- method +- queryParameters +- body +- timestamp +title: RequestModel +type: object diff --git a/api/services/security/v1/schemas/RulesModel.yaml b/api/services/security/v1/schemas/RulesModel.yaml new file mode 100644 index 000000000..27abfb757 --- /dev/null +++ b/api/services/security/v1/schemas/RulesModel.yaml @@ -0,0 +1,64 @@ +properties: + args: + description: 'Certain misconfiguration rules have arguments. This field contains + the arguments in the form of an comma separated array. Example: ["MongoDB", + "TCP", "27017"]' + items: + type: string + title: Args + type: array + cloud: + description: The name of the cloud. + title: Cloud + type: string + complianceName: + description: The name of the cyber security compliance. + items: + type: string + title: Compliancename + type: array + controls: + description: The ID of the control defined in the compliance. + items: + additionalProperties: + type: string + type: object + title: Controls + type: array + description: + description: Description of the rule. + title: Description + type: string + effort: + allOf: + - $ref: ./Effort.yaml + description: The effort required to fix the finding. + ruleName: + description: The unique name of the rule. + title: Rulename + type: string + ruleTitle: + description: The name of the rule. + title: Ruletitle + type: string + service: + description: The cloud service. + title: Service + type: string + severity: + allOf: + - $ref: ./Severity.yaml + description: The severity of the rule. +required: +- ruleName +- ruleTitle +- description +- cloud +- service +- args +- severity +- effort +- complianceName +- controls +title: RulesModel +type: object diff --git a/api/services/security/v1/schemas/Severity.yaml b/api/services/security/v1/schemas/Severity.yaml new file mode 100644 index 000000000..0cfdbf87f --- /dev/null +++ b/api/services/security/v1/schemas/Severity.yaml @@ -0,0 +1,7 @@ +enum: +- Critical +- High +- Medium +- Low +title: Severity +type: string diff --git a/api/services/security/v1/schemas/SpotResponse_BaseResponse_CountModel__.yaml b/api/services/security/v1/schemas/SpotResponse_BaseResponse_CountModel__.yaml new file mode 100644 index 000000000..cbeb655bb --- /dev/null +++ b/api/services/security/v1/schemas/SpotResponse_BaseResponse_CountModel__.yaml @@ -0,0 +1,17 @@ +properties: + error: + allOf: + - $ref: ./ErrorModel.yaml + title: Error + request: + $ref: ./RequestModel.yaml + response: + allOf: + - $ref: ./BaseResponse_CountModel_.yaml + responseTime: + title: Responsetime + type: number +required: +- request +title: SpotResponse[BaseResponse[CountModel]] +type: object diff --git a/api/services/security/v1/schemas/SpotResponse_PaginatedResponse_ComplianceModel__.yaml b/api/services/security/v1/schemas/SpotResponse_PaginatedResponse_ComplianceModel__.yaml new file mode 100644 index 000000000..848a17869 --- /dev/null +++ b/api/services/security/v1/schemas/SpotResponse_PaginatedResponse_ComplianceModel__.yaml @@ -0,0 +1,17 @@ +properties: + error: + allOf: + - $ref: ./ErrorModel.yaml + title: Error + request: + $ref: ./RequestModel.yaml + response: + allOf: + - $ref: ./PaginatedResponse_ComplianceModel_.yaml + responseTime: + title: Responsetime + type: number +required: +- request +title: SpotResponse[PaginatedResponse[ComplianceModel]] +type: object diff --git a/api/services/security/v1/schemas/SpotResponse_PaginatedResponse_ControlModel__.yaml b/api/services/security/v1/schemas/SpotResponse_PaginatedResponse_ControlModel__.yaml new file mode 100644 index 000000000..a692ad6d4 --- /dev/null +++ b/api/services/security/v1/schemas/SpotResponse_PaginatedResponse_ControlModel__.yaml @@ -0,0 +1,17 @@ +properties: + error: + allOf: + - $ref: ./ErrorModel.yaml + title: Error + request: + $ref: ./RequestModel.yaml + response: + allOf: + - $ref: ./PaginatedResponse_ControlModel_.yaml + responseTime: + title: Responsetime + type: number +required: +- request +title: SpotResponse[PaginatedResponse[ControlModel]] +type: object diff --git a/api/services/security/v1/schemas/SpotResponse_PaginatedResponse_MisconfigurationModel__.yaml b/api/services/security/v1/schemas/SpotResponse_PaginatedResponse_MisconfigurationModel__.yaml new file mode 100644 index 000000000..a04117480 --- /dev/null +++ b/api/services/security/v1/schemas/SpotResponse_PaginatedResponse_MisconfigurationModel__.yaml @@ -0,0 +1,17 @@ +properties: + error: + allOf: + - $ref: ./ErrorModel.yaml + title: Error + request: + $ref: ./RequestModel.yaml + response: + allOf: + - $ref: ./PaginatedResponse_MisconfigurationModel_.yaml + responseTime: + title: Responsetime + type: number +required: +- request +title: SpotResponse[PaginatedResponse[MisconfigurationModel]] +type: object diff --git a/api/services/security/v1/schemas/SpotResponse_PaginatedResponse_RulesModel__.yaml b/api/services/security/v1/schemas/SpotResponse_PaginatedResponse_RulesModel__.yaml new file mode 100644 index 000000000..9f9150299 --- /dev/null +++ b/api/services/security/v1/schemas/SpotResponse_PaginatedResponse_RulesModel__.yaml @@ -0,0 +1,17 @@ +properties: + error: + allOf: + - $ref: ./ErrorModel.yaml + title: Error + request: + $ref: ./RequestModel.yaml + response: + allOf: + - $ref: ./PaginatedResponse_RulesModel_.yaml + responseTime: + title: Responsetime + type: number +required: +- request +title: SpotResponse[PaginatedResponse[RulesModel]] +type: object diff --git a/api/services/security/v1/schemas/StatusModel.yaml b/api/services/security/v1/schemas/StatusModel.yaml new file mode 100644 index 000000000..1e82dac79 --- /dev/null +++ b/api/services/security/v1/schemas/StatusModel.yaml @@ -0,0 +1,12 @@ +properties: + code: + title: Code + type: integer + message: + title: Message + type: string +required: +- code +- message +title: StatusModel +type: object diff --git a/api/services/security/v1/schemas/ValidationError.yaml b/api/services/security/v1/schemas/ValidationError.yaml new file mode 100644 index 000000000..bb8db41b6 --- /dev/null +++ b/api/services/security/v1/schemas/ValidationError.yaml @@ -0,0 +1,20 @@ +properties: + loc: + items: + anyOf: + - type: string + - type: integer + title: Location + type: array + msg: + title: Message + type: string + type: + title: Error Type + type: string +required: +- loc +- msg +- type +title: ValidationError +type: object diff --git a/api/services/security/v1/schemas/cloud__constant__base__CloudProvider.yaml b/api/services/security/v1/schemas/cloud__constant__base__CloudProvider.yaml new file mode 100644 index 000000000..187e1baa3 --- /dev/null +++ b/api/services/security/v1/schemas/cloud__constant__base__CloudProvider.yaml @@ -0,0 +1,6 @@ +description: Enumeration of supported cloud providers. +enum: +- aws +- azure +title: CloudProvider +type: string diff --git a/api/services/security/v1/schemas/databases__constant__CloudProvider.yaml b/api/services/security/v1/schemas/databases__constant__CloudProvider.yaml new file mode 100644 index 000000000..ebb62a5a2 --- /dev/null +++ b/api/services/security/v1/schemas/databases__constant__CloudProvider.yaml @@ -0,0 +1,6 @@ +description: Supported cloud providers. +enum: +- aws +- azure +title: CloudProvider +type: string diff --git a/api/spot.yaml b/api/spot.yaml index 23f668de8..c4279b73b 100644 --- a/api/spot.yaml +++ b/api/spot.yaml @@ -220,6 +220,10 @@ x-tagGroups: - Connect Targets - Connect Workflows - Connect Workspaces + - name: Spot Security + tags: + - Compliance + - Misconfiguration paths: /aws/ec2/group: @@ -924,8 +928,24 @@ paths: /ocean/{oceanId}/rightSizing/rule/{ruleName}/detachment: $ref: services/ocean/rightsizing/paths/oceanRightsizingRuleDetachment.yaml /ocean/{oceanId}/rightSizing/recommendations: - $ref: services/ocean/rightsizing/paths/oceanRightsizingRecommendations.yaml + $ref: services/ocean/rightsizing/paths/oceanRightsizingRecommendations.yaml /ocean/{oceanId}/rightSizing/rollbacks: $ref: services/ocean/rightsizing/paths/oceanRightsizingRollbacks.yaml /ocean/{oceanId}/rightSizing/rollbacks/acknowledge: $ref: services/ocean/rightsizing/paths/oceanRightsizingAcknowledgeRollbacks.yaml + /security/v1/compliances: + $ref: services/security/v1/paths/compliances.yaml + /security/v1/compliances/count: + $ref: services/security/v1/paths/count.yaml + /security/v1/compliances/{complianceName}/controls: + $ref: services/security/v1/paths/controls.yaml + /security/v1/compliances/{complianceName}/controls/count: + $ref: services/security/v1/paths/controls_count.yaml + /security/v1/misconfigurations: + $ref: services/security/v1/paths/misconfigurations.yaml + /security/v1/misconfigurations/count: + $ref: services/security/v1/paths/misconfigurations_count.yaml + /security/v1/misconfigurations/rules: + $ref: services/security/v1/paths/rules.yaml + /security/v1/misconfigurations/rules/count: + $ref: services/security/v1/paths/rules_count.yaml \ No newline at end of file From 1dddf311d349db81c3c6969ae0abd571e85add08 Mon Sep 17 00:00:00 2001 From: noasaunders219 <117283483+noasaunders219@users.noreply.github.com> Date: Tue, 10 Dec 2024 09:59:21 +0200 Subject: [PATCH 4/6] CON-31930_openapi (#688) * added scheduling * added scheduling * added scheduling to vng template * added scheduling to vng update --------- Co-authored-by: yardenE <41858765+yardenE@users.noreply.github.com> --- .../ocean/aks/schemas/update/ocean-virtualNodeGroup.yaml | 4 +++- .../aks/schemas/update/ocean-virtualNodeGroupTemplate.yaml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/api/services/ocean/aks/schemas/update/ocean-virtualNodeGroup.yaml b/api/services/ocean/aks/schemas/update/ocean-virtualNodeGroup.yaml index 6d6482353..25870796c 100644 --- a/api/services/ocean/aks/schemas/update/ocean-virtualNodeGroup.yaml +++ b/api/services/ocean/aks/schemas/update/ocean-virtualNodeGroup.yaml @@ -81,4 +81,6 @@ properties: description: | A maximum of 10 unique key-value pairs for VM tags in the virtual node group. vmSizes: - $ref: "../../schemas/ocean-vmSizes.yaml" \ No newline at end of file + $ref: "../../schemas/ocean-vmSizes.yaml" + scheduling: + $ref: "../../schemas/virtualNodeGroup-scheduling.yaml" \ No newline at end of file diff --git a/api/services/ocean/aks/schemas/update/ocean-virtualNodeGroupTemplate.yaml b/api/services/ocean/aks/schemas/update/ocean-virtualNodeGroupTemplate.yaml index 0d4c0960c..57b35c24f 100644 --- a/api/services/ocean/aks/schemas/update/ocean-virtualNodeGroupTemplate.yaml +++ b/api/services/ocean/aks/schemas/update/ocean-virtualNodeGroupTemplate.yaml @@ -77,3 +77,5 @@ properties: A maximum of 10 unique key-value pairs for VM tags in the virtual node group. vmSizes: $ref: "../../schemas/ocean-vmSizes.yaml" + scheduling: + $ref: "../../schemas/virtualNodeGroup-scheduling.yaml" From 72112fa7c1f5d25ab82b1bc9b641b069f28568aa Mon Sep 17 00:00:00 2001 From: noasaunders219 <117283483+noasaunders219@users.noreply.github.com> Date: Tue, 10 Dec 2024 10:03:41 +0200 Subject: [PATCH 5/6] noa/feature/CON-30969_shutdownHoursPerVng (#683) * added scheduling * added scheduling * added scheduling to vng template --------- Co-authored-by: yardenE <41858765+yardenE@users.noreply.github.com> From c1d8730ebaa8bf90919da133128a9a6fed19039f Mon Sep 17 00:00:00 2001 From: Paul van Wichen <126611130+paul-van-wichen@users.noreply.github.com> Date: Wed, 11 Dec 2024 07:49:57 -0500 Subject: [PATCH 6/6] DOC-2166 / SF-18880 - add Cost Intelligence 'Setup CI on Spot account' related API endpoints. (#689) --- api/commons/schemas/errorModel.yaml | 11 +++ api/commons/schemas/errorResponse.yaml | 12 +++ .../schemas/paginatedResponseItemWrapper.yaml | 25 ++++++ api/commons/schemas/paginationInfo.yaml | 15 ++++ .../beci/setup/paths/cbiV1SetupAccount.yaml | 77 +++++++++++++++++++ .../paths/cbiV1SetupAccountValidation.yaml | 34 ++++++++ .../responses/get200cbiV1SetupAccount.yaml | 24 ++++++ .../responses/post200cbiV1SetupAccount.yaml | 24 ++++++ .../post200cbiV1SetupAccountValidation.yaml | 24 ++++++ .../schemas/CIRegisteredAccountResponse.yaml | 37 +++++++++ ...CIRegisteredAccountWithStatusResponse.yaml | 45 +++++++++++ api/services/beci/setup/schemas/account.yaml | 8 ++ .../beci/setup/schemas/accountStatusItem.yaml | 29 +++++++ .../setup/schemas/accountStatusStatistic.yaml | 24 ++++++ .../setup/schemas/accountStatusSummary.yaml | 6 ++ .../beci/setup/schemas/cloudProvider.yaml | 6 ++ .../createCIRegisteredAccountModel.yaml | 7 ++ .../setup/schemas/productOfferingEnum.yaml | 6 ++ .../schemas/validationModelResponse.yaml | 25 ++++++ .../beci/setup/schemas/validationStatus.yaml | 7 ++ api/spot.yaml | 8 +- 21 files changed, 453 insertions(+), 1 deletion(-) create mode 100644 api/commons/schemas/errorModel.yaml create mode 100644 api/commons/schemas/errorResponse.yaml create mode 100644 api/commons/schemas/paginatedResponseItemWrapper.yaml create mode 100644 api/commons/schemas/paginationInfo.yaml create mode 100644 api/services/beci/setup/paths/cbiV1SetupAccount.yaml create mode 100644 api/services/beci/setup/paths/cbiV1SetupAccountValidation.yaml create mode 100644 api/services/beci/setup/responses/get200cbiV1SetupAccount.yaml create mode 100644 api/services/beci/setup/responses/post200cbiV1SetupAccount.yaml create mode 100644 api/services/beci/setup/responses/post200cbiV1SetupAccountValidation.yaml create mode 100644 api/services/beci/setup/schemas/CIRegisteredAccountResponse.yaml create mode 100644 api/services/beci/setup/schemas/CIRegisteredAccountWithStatusResponse.yaml create mode 100644 api/services/beci/setup/schemas/account.yaml create mode 100644 api/services/beci/setup/schemas/accountStatusItem.yaml create mode 100644 api/services/beci/setup/schemas/accountStatusStatistic.yaml create mode 100644 api/services/beci/setup/schemas/accountStatusSummary.yaml create mode 100644 api/services/beci/setup/schemas/cloudProvider.yaml create mode 100644 api/services/beci/setup/schemas/createCIRegisteredAccountModel.yaml create mode 100644 api/services/beci/setup/schemas/productOfferingEnum.yaml create mode 100644 api/services/beci/setup/schemas/validationModelResponse.yaml create mode 100644 api/services/beci/setup/schemas/validationStatus.yaml diff --git a/api/commons/schemas/errorModel.yaml b/api/commons/schemas/errorModel.yaml new file mode 100644 index 000000000..1345b38ca --- /dev/null +++ b/api/commons/schemas/errorModel.yaml @@ -0,0 +1,11 @@ +properties: + code: + type: string + description: Error code. + message: + type: string + description: Error message. +type: object +required: +- message +title: ErrorModel \ No newline at end of file diff --git a/api/commons/schemas/errorResponse.yaml b/api/commons/schemas/errorResponse.yaml new file mode 100644 index 000000000..2eb2bcaa6 --- /dev/null +++ b/api/commons/schemas/errorResponse.yaml @@ -0,0 +1,12 @@ +allOf: + - $ref: "../schemas/responseWrapper.yaml" + - type: "object" + properties: + response: + type: "object" + properties: + errors: + type: "array" + description: List of errors. + items: + $ref: "../schemas/errorModel.yaml" diff --git a/api/commons/schemas/paginatedResponseItemWrapper.yaml b/api/commons/schemas/paginatedResponseItemWrapper.yaml new file mode 100644 index 000000000..fab448a45 --- /dev/null +++ b/api/commons/schemas/paginatedResponseItemWrapper.yaml @@ -0,0 +1,25 @@ +allOf: + - $ref: "../schemas/responseWrapper.yaml" + - type: "object" + properties: + response: + type: "object" + properties: + items: + type: "array" + description: > + Array of data objects. + items: + type: "object" + count: + type: "integer" + example: 1 + description: > + Size of the data object array. + kind: + type: "string" + description: > + The data type of each item in the response. + paginationInfo: + $ref: "../schemas/paginationInfo.yaml" + nullable: true diff --git a/api/commons/schemas/paginationInfo.yaml b/api/commons/schemas/paginationInfo.yaml new file mode 100644 index 000000000..1a1559926 --- /dev/null +++ b/api/commons/schemas/paginationInfo.yaml @@ -0,0 +1,15 @@ +properties: + totalCount: + type: integer + nullable: true + description: "[Optional/Not supported on all APIs] Total number of items (for all pages)." + nextKey: + type: string + nullable: true + description: Key used to fetch next page of data (if any). + previousKey: + type: string + nullable: true + description: Key used to fetch previous page of data (if any). +type: object +title: PaginationInfo \ No newline at end of file diff --git a/api/services/beci/setup/paths/cbiV1SetupAccount.yaml b/api/services/beci/setup/paths/cbiV1SetupAccount.yaml new file mode 100644 index 000000000..bb06a5fbc --- /dev/null +++ b/api/services/beci/setup/paths/cbiV1SetupAccount.yaml @@ -0,0 +1,77 @@ +post: + tags: + - Accounts + summary: Setup Cost Intelligence + description: Sets up and enables Cost Intelligence functionality on a Spot account. + The Spot account must already have credentials and be linked to a valid cloud + provider account (e.g. AWS account, Azure subscription, etc). + operationId: setupAccountCbiV1SetupAccountPost + requestBody: + required: true + content: + application/json: + schema: + $ref: ../schemas/createCIRegisteredAccountModel.yaml + responses: + '200': + $ref: ../responses/post200cbiV1SetupAccount.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 +get: + tags: + - Accounts + summary: Get Cost Intelligence Registered Accounts + description: Get list of Spot accounts where Cost Intelligence has been setup. + operationId: getAccountsCbiV1SetupAccountGet + 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 + responses: + '200': + $ref: ../responses/get200cbiV1SetupAccount.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/setup/paths/cbiV1SetupAccountValidation.yaml b/api/services/beci/setup/paths/cbiV1SetupAccountValidation.yaml new file mode 100644 index 000000000..66bc6bbef --- /dev/null +++ b/api/services/beci/setup/paths/cbiV1SetupAccountValidation.yaml @@ -0,0 +1,34 @@ +post: + tags: + - Accounts + summary: Perform Cost Intelligence Setup Validations + description: Validate that Cost Intelligence can be setup on the specified Spot + Account. + operationId: validateSetupAccountCbiV1SetupAccountValidationPost + requestBody: + required: true + content: + application/json: + schema: + $ref: ../schemas/createCIRegisteredAccountModel.yaml + responses: + '200': + $ref: ../responses/post200cbiV1SetupAccountValidation.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/setup/responses/get200cbiV1SetupAccount.yaml b/api/services/beci/setup/responses/get200cbiV1SetupAccount.yaml new file mode 100644 index 000000000..ede6ce88d --- /dev/null +++ b/api/services/beci/setup/responses/get200cbiV1SetupAccount.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/setup/account + method: + example: GET + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/CIRegisteredAccountWithStatusResponse.yaml + kind: + example: string diff --git a/api/services/beci/setup/responses/post200cbiV1SetupAccount.yaml b/api/services/beci/setup/responses/post200cbiV1SetupAccount.yaml new file mode 100644 index 000000000..f08bf5cce --- /dev/null +++ b/api/services/beci/setup/responses/post200cbiV1SetupAccount.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/setup/account + method: + example: POST + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/CIRegisteredAccountResponse.yaml + kind: + example: spotinst:cbi:inventory:ciRegisteredAccount diff --git a/api/services/beci/setup/responses/post200cbiV1SetupAccountValidation.yaml b/api/services/beci/setup/responses/post200cbiV1SetupAccountValidation.yaml new file mode 100644 index 000000000..db2376d80 --- /dev/null +++ b/api/services/beci/setup/responses/post200cbiV1SetupAccountValidation.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/setup/account/validation + method: + example: POST + response: + type: object + properties: + items: + type: array + items: + $ref: ../schemas/validationModelResponse.yaml + kind: + example: spotinst:cbi:accountRegistrationValidation diff --git a/api/services/beci/setup/schemas/CIRegisteredAccountResponse.yaml b/api/services/beci/setup/schemas/CIRegisteredAccountResponse.yaml new file mode 100644 index 000000000..56ffe0880 --- /dev/null +++ b/api/services/beci/setup/schemas/CIRegisteredAccountResponse.yaml @@ -0,0 +1,37 @@ +properties: + organizationId: + type: string + description: Spot Organization ID. + example: '60100100100100' + accountId: + type: string + description: Spot Account ID. + example: act-012345 + providerName: + $ref: cloudProvider.yaml + description: Cloud provider of setup account. + example: aws + externalProviderId: + type: string + description: Cloud provider of setup account. + example: '012345678901' + enabledDate: + type: string + format: date-time + description: Date/time when Cost Intelligence was registered on the Spot account. + updatedDate: + type: string + format: date-time + description: Date/time when the Cost Intelligence registration was updated on + the Spot account. +type: object +required: + - organizationId + - accountId + - providerName + - externalProviderId + - enabledDate + - updatedDate +title: CIRegisteredAccountResponse +description: Represents a Spot account on which Cost Intelligence has been registered + / enabled. [kind/spotinst:cbi:inventory:ciRegisteredAccount] diff --git a/api/services/beci/setup/schemas/CIRegisteredAccountWithStatusResponse.yaml b/api/services/beci/setup/schemas/CIRegisteredAccountWithStatusResponse.yaml new file mode 100644 index 000000000..72f14a7e2 --- /dev/null +++ b/api/services/beci/setup/schemas/CIRegisteredAccountWithStatusResponse.yaml @@ -0,0 +1,45 @@ +properties: + organizationId: + type: string + description: Spot Organization ID. + example: '60100100100100' + accountId: + type: string + description: Spot Account ID. + example: act-012345 + providerName: + $ref: cloudProvider.yaml + description: Cloud provider of setup account. + example: aws + externalProviderId: + type: string + description: Cloud provider of setup account. + example: '012345678901' + enabledDate: + type: string + format: date-time + description: Date/time when Cost Intelligence was registered on the Spot account. + updatedDate: + type: string + format: date-time + description: Date/time when the Cost Intelligence registration was updated on + the Spot account. + statusSummary: + $ref: accountStatusSummary.yaml + description: Account status summary. + status: + description: Account status + type: array + items: + $ref: accountStatusItem.yaml + nullable: true +type: object +required: + - organizationId + - accountId + - providerName + - externalProviderId + - enabledDate + - updatedDate + - statusSummary +title: CIRegisteredAccountWithStatusResponse diff --git a/api/services/beci/setup/schemas/account.yaml b/api/services/beci/setup/schemas/account.yaml new file mode 100644 index 000000000..4784d0592 --- /dev/null +++ b/api/services/beci/setup/schemas/account.yaml @@ -0,0 +1,8 @@ +properties: + accountId: + type: string + description: Spot account ID +type: object +required: + - accountId +title: Account diff --git a/api/services/beci/setup/schemas/accountStatusItem.yaml b/api/services/beci/setup/schemas/accountStatusItem.yaml new file mode 100644 index 000000000..e63898753 --- /dev/null +++ b/api/services/beci/setup/schemas/accountStatusItem.yaml @@ -0,0 +1,29 @@ +properties: + productOffering: + $ref: productOfferingEnum.yaml + description: Product offering. + statusType: + type: string + description: Status type. + statusCode: + type: string + description: Status code. + statusMessage: + description: Status message. + type: string + nullable: true + statistics: + description: Status statistics. + $ref: accountStatusStatistic.yaml + nullable: true + statusTimestamp: + type: string + format: date-time + description: Status timestamp. +type: object +required: + - productOffering + - statusType + - statusCode + - statusTimestamp +title: AccountStatusItem diff --git a/api/services/beci/setup/schemas/accountStatusStatistic.yaml b/api/services/beci/setup/schemas/accountStatusStatistic.yaml new file mode 100644 index 000000000..6d69dd418 --- /dev/null +++ b/api/services/beci/setup/schemas/accountStatusStatistic.yaml @@ -0,0 +1,24 @@ +properties: + totalResourceTypeCount: + type: integer + description: Total number of resource types. + failedResourceTypeCount: + type: integer + description: Failed number of resource types. + successfulResourceTypes: + description: Successful resource types. + type: array + items: + type: string + nullable: true + failedResourceTypes: + description: Failed resource types. + type: array + items: + type: string + nullable: true +type: object +required: + - totalResourceTypeCount + - failedResourceTypeCount +title: AccountStatusStatistic diff --git a/api/services/beci/setup/schemas/accountStatusSummary.yaml b/api/services/beci/setup/schemas/accountStatusSummary.yaml new file mode 100644 index 000000000..b21d1e8f2 --- /dev/null +++ b/api/services/beci/setup/schemas/accountStatusSummary.yaml @@ -0,0 +1,6 @@ +type: string +enum: + - connected + - notConnected + - partiallyConnected +title: AccountStatusSummary diff --git a/api/services/beci/setup/schemas/cloudProvider.yaml b/api/services/beci/setup/schemas/cloudProvider.yaml new file mode 100644 index 000000000..bbb7a2c67 --- /dev/null +++ b/api/services/beci/setup/schemas/cloudProvider.yaml @@ -0,0 +1,6 @@ +type: string +enum: + - aws + - azure + - gcp +title: CloudProvider diff --git a/api/services/beci/setup/schemas/createCIRegisteredAccountModel.yaml b/api/services/beci/setup/schemas/createCIRegisteredAccountModel.yaml new file mode 100644 index 000000000..b2d1c2d40 --- /dev/null +++ b/api/services/beci/setup/schemas/createCIRegisteredAccountModel.yaml @@ -0,0 +1,7 @@ +properties: + account: + $ref: account.yaml +type: object +required: + - account +title: CreateCIRegisteredAccountModel diff --git a/api/services/beci/setup/schemas/productOfferingEnum.yaml b/api/services/beci/setup/schemas/productOfferingEnum.yaml new file mode 100644 index 000000000..7da50a4de --- /dev/null +++ b/api/services/beci/setup/schemas/productOfferingEnum.yaml @@ -0,0 +1,6 @@ +type: string +enum: + - common + - cloudBilling + - cbi +title: ProductOfferingEnum diff --git a/api/services/beci/setup/schemas/validationModelResponse.yaml b/api/services/beci/setup/schemas/validationModelResponse.yaml new file mode 100644 index 000000000..6ae3f5436 --- /dev/null +++ b/api/services/beci/setup/schemas/validationModelResponse.yaml @@ -0,0 +1,25 @@ +properties: + id: + type: string + description: Unique ID of the validation step that was performed. + description: + description: Summary of the validation step (i.e. what validation check was performed). + type: string + nullable: true + status: + $ref: validationStatus.yaml + description: Overall status of the validation step. + validationInfo: + description: Additional information about the reason the validation step failed. + type: string + nullable: true + validationInfoDetails: + description: Validation info details + type: object + nullable: true +type: object +required: + - id + - status +title: ValidationModelResponse +description: '[kind/spotinst:cbi:accountRegistrationValidation]' diff --git a/api/services/beci/setup/schemas/validationStatus.yaml b/api/services/beci/setup/schemas/validationStatus.yaml new file mode 100644 index 000000000..83576437f --- /dev/null +++ b/api/services/beci/setup/schemas/validationStatus.yaml @@ -0,0 +1,7 @@ +type: string +enum: + - success + - failed + - warning + - skipped +title: ValidationStatus diff --git a/api/spot.yaml b/api/spot.yaml index c4279b73b..92e187660 100644 --- a/api/spot.yaml +++ b/api/spot.yaml @@ -948,4 +948,10 @@ paths: /security/v1/misconfigurations/rules: $ref: services/security/v1/paths/rules.yaml /security/v1/misconfigurations/rules/count: - $ref: services/security/v1/paths/rules_count.yaml \ No newline at end of file + $ref: services/security/v1/paths/rules_count.yaml + # + /cbi/v1/setup/account: + $ref: services/beci/setup/paths/cbiV1SetupAccount.yaml + /cbi/v1/setup/account/validation: + $ref: services/beci/setup/paths/cbiV1SetupAccountValidation.yaml + #