Skip to content

Commit 9384150

Browse files
authored
Merge pull request #826 from zdaniel86/auto-update-1643643414
Definitions Update assets_manager
2 parents 5bc0c51 + f5c4f23 commit 9384150

File tree

5 files changed

+338
-0
lines changed

5 files changed

+338
-0
lines changed
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
openapi: 3.0.1
2+
info:
3+
title: Assets Manager API
4+
contact:
5+
6+
name: Alert Logic Support
7+
url: https://support.alertlogic.com
8+
x-alertlogic-iws-service:
9+
type: public
10+
description: |-
11+
The assets management service. The service provides additional validation
12+
layer in front of assets to ensure the user supplied configuration is consistent.
13+
The service also provides different utility functions.
14+
version: 1.0.0
15+
servers:
16+
- url: https://api.cloudinsight.alertlogic.com
17+
x-alertlogic-session-endpoint: true
18+
description: production (US)
19+
- url: https://api.cloudinsight.alertlogic.co.uk
20+
description: production (UK)
21+
x-alertlogic-session-endpoint: true
22+
- url: https://api.product.dev.alertlogic.com
23+
description: integration
24+
components:
25+
securitySchemes:
26+
x-aims-auth-token:
27+
name: x-aims-auth-token
28+
type: apiKey
29+
in: header
30+
description: AIMS Authentication Token
31+
paths:
32+
/assets_manager/v1/{account_id}/deployments/{deployment_id}/scope/export:
33+
post:
34+
operationId: export_scope
35+
tags:
36+
- Protection Scope Management
37+
summary: Export protection scope
38+
description: |-
39+
Endpoint for exporting the protection scope of a deployment along with
40+
asset metadata. By default the endpoints returns data in `CSV` format
41+
if no `Accept` header specified.
42+
cURL example:
43+
parameters:
44+
- $ref: 'parameters.yaml#/UrlParamAccountId'
45+
- $ref: 'parameters.yaml#/UrlParamDeploymentId'
46+
security:
47+
- x-aims-auth-token: []
48+
x-codeSamples:
49+
- lang: Shell
50+
label: alcli
51+
source: |
52+
alcli assets_manager export_scope \
53+
--account_id 134235158 \
54+
--deployment_id 843BD5F3-583D-48D7-B929-616B100D6B7B \
55+
> scope.csv
56+
- lang: cURL
57+
label: cURL
58+
source: |
59+
curl -X POST \
60+
https://api.product.dev.alertlogic.com/assets_manager/v1/134235158/deployments/843BD5F3-583D-48D7-B929-616B100D6B7B/scope/export \
61+
> scope.csv
62+
responses:
63+
'200':
64+
description: OK
65+
content:
66+
text/csv:
67+
schema:
68+
$ref: 'schemas.yaml#/AssetsProtection'
69+
examples:
70+
CSV:
71+
$ref: 'examples.yaml#/ScopeCSV'
72+
application/json:
73+
schema:
74+
$ref: 'schemas.yaml#/AssetsProtection'
75+
examples:
76+
JSON:
77+
$ref: 'examples.yaml#/ScopeJSON'
78+
'401':
79+
$ref: 'responses.yaml#/Unauthorized'
80+
'403':
81+
$ref: 'responses.yaml#/Forbidden'
82+
'404':
83+
$ref: 'responses.yaml#/DeploymentNotFound'
84+
/assets_manager/v1/{account_id}/deployments/{deployment_id}/scope/import:
85+
post:
86+
operationId: import_scope
87+
tags:
88+
- Protection Scope Management
89+
requestBody:
90+
description: |-
91+
By default If no `Content-Type` header specified the `CSV` format assumed.
92+
The data format is the same as returned by the export endpoint.
93+
The required fields are: `type`, `key` and `protection_level`.
94+
All other fields are ignored. Any invalid items are ignored.
95+
The protection scope policy id to `protection_level` mapping:
96+
* `D12D5E67-166C-474F-87AA-6F86FC9FB9BC` - professional
97+
* `A8E8B104-8F45-411D-A240-A30EA5FE25B0` - essentials
98+
* `EC735B49-2517-4D98-BB9D-BEBC1E75D56D` - enterprise
99+
* `A562D3E4-ECBE-426E-B2CF-78D2336E5D63` - lm_essentials
100+
* `7E184449-FB15-4693-807F-C01A1ECD7E66` - lmpro
101+
* `D2A589A9-EA56-456C-844E-65843B483D68` - tmpro
102+
required: true
103+
content:
104+
text/csv:
105+
examples:
106+
CSV:
107+
$ref: 'examples.yaml#/ScopeCSV'
108+
schema:
109+
$ref: 'schemas.yaml#/AssetsProtection'
110+
application/json:
111+
examples:
112+
JSON:
113+
$ref: 'examples.yaml#/ScopeJSON'
114+
schema:
115+
$ref: 'schemas.yaml#/AssetsProtection'
116+
summary: Import protection scope
117+
description: |-
118+
Endpoint for importing the protection scope of a deployment.
119+
parameters:
120+
- $ref: 'parameters.yaml#/UrlParamAccountId'
121+
- $ref: 'parameters.yaml#/UrlParamDeploymentId'
122+
- $ref: 'parameters.yaml#/WriteOption'
123+
security:
124+
- x-aims-auth-token: []
125+
x-codeSamples:
126+
- lang: Shell
127+
label: alcli
128+
source: |
129+
alcli assets_manager import_scope \
130+
--account_id 134235158 \
131+
--deployment_id 843BD5F3-583D-48D7-B929-616B100D6B7B \
132+
--content_type=text/csv \
133+
--write true \
134+
--data file://scope.csv
135+
- lang: cURL
136+
label: cURL
137+
source: |
138+
curl -X POST \
139+
https://api.product.dev.alertlogic.com/assets_manager/v1/134235158/deployments/843BD5F3-583D-48D7-B929-616B100D6B7B/scope/import?write=true \
140+
--data-binary @scope.csv
141+
responses:
142+
'200':
143+
description: OK
144+
content:
145+
application/json:
146+
examples:
147+
JSON:
148+
$ref: 'examples.yaml#/ImportSummary'
149+
schema:
150+
$ref: 'schemas.yaml#/ImportSummary'
151+
'401':
152+
$ref: 'responses.yaml#/Unauthorized'
153+
'403':
154+
$ref: 'responses.yaml#/Forbidden'
155+
'404':
156+
$ref: 'responses.yaml#/DeploymentNotFound'
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
ScopeJSON:
2+
value:
3+
- deployment_id: 843BD5F3-583D-48D7-B929-616B100D6B7B
4+
vpc: vpc-43f82c3a
5+
type: subnet
6+
region: us-west-2
7+
protection_level: inherited
8+
name: subnet-974c78df
9+
key: /aws/us-west-2/subnet/subnet-974c78df
10+
account_id: 12345678
11+
cidr_block: 172.31.32.0/20
12+
13+
ScopeCSV:
14+
value: |
15+
type,key,name,protection_level,cidr_block,region,network,subnet,cidr_ranges
16+
vpc,/aws/us-west-2/vpc/vpc-43f82c3a,vpc-43f82c3a,inherited,172.31.0.0/16,us-west-2,,,"[""172.31.0.0/16""]"
17+
subnet,/aws/us-west-2/subnet/subnet-094f8853,subnet-094f8853,inherited,172.31.0.0/20,us-west-2,,,
18+
subnet,/aws/us-west-2/subnet/subnet-78f2e71e,subnet-78f2e71e,inherited,172.31.16.0/20,us-west-2,,,
19+
subnet,/aws/us-west-2/subnet/subnet-94ccb0bc,subnet-94ccb0bc,inherited,172.31.48.0/20,us-west-2,,,
20+
subnet,/aws/us-west-2/subnet/subnet-974c78df,subnet-974c78df,inherited,172.31.32.0/20,us-west-2,,,
21+
22+
ImportSummary:
23+
value:
24+
new_scope:
25+
include:
26+
- type: vpc
27+
policy:
28+
id: D12D5E67-166C-474F-87AA-6F86FC9FB9BC
29+
key: "/aws/ca-central-1/vpc/vpc-e0a0a689"
30+
exclude:
31+
- type: host
32+
key: "/aws/ca-central-1/host/i-031b312d8b6472247"
33+
included:
34+
- type: vpc
35+
policy:
36+
id: D12D5E67-166C-474F-87AA-6F86FC9FB9BC
37+
key: "/aws/ca-central-1/vpc/vpc-e0a0a689"
38+
excluded:
39+
- type: region
40+
policy:
41+
id: D12D5E67-166C-474F-87AA-6F86FC9FB9BC
42+
key: "/aws/us-east-1"
43+
- type: host
44+
policy:
45+
id: D12D5E67-166C-474F-87AA-6F86FC9FB9BC
46+
key: "/aws/eu-west-2/host/i-0e36e01a0efd53cbf"
47+
- type: host
48+
key: "/aws/ca-central-1/host/i-031b312d8b6472247"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
WriteOption:
2+
schema:
3+
type: boolean
4+
default: false
5+
description: |-
6+
The option is used to perform write operation if specified as `true`.
7+
Otherwise the endpoint works in dry-run mode.
8+
If no option specified the `false` is assumed.
9+
name: write
10+
in: query
11+
required: false
12+
UrlParamAccountId:
13+
schema:
14+
type: string
15+
name: account_id
16+
in: path
17+
required: true
18+
description: |-
19+
The AIMS account ID whose assets are being accessed. Only valid account IDs are acceptable.
20+
Invalid account IDs result in an `HTTP 404 Not Found` or `HTTP 403 Forbidden`, depending on
21+
the client's access level.
22+
UrlParamDeploymentId:
23+
schema:
24+
type: string
25+
name: deployment_id
26+
in: path
27+
required: true
28+
description: The ID of the deployment source as represented in the deployments service (uppercase UUID).
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
DeploymentNotFound:
2+
description: '`deployment not found`'
3+
Unauthorized:
4+
description: '`Unauthorized`. The provided `x-aims-auth-token` header could not be authenticated.'
5+
Forbidden:
6+
description: '`Forbidden`. Insufficient permissions.'
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
ImportSummary:
2+
description: 'Import result summary'
3+
type: object
4+
properties:
5+
included:
6+
description: Scope items protected by the request
7+
type: array
8+
items:
9+
$ref: '#/ScopeItem'
10+
excluded:
11+
description: Scope items unprotected by the request
12+
type: array
13+
items:
14+
$ref: '#/ScopeItem'
15+
new_scope:
16+
description: The new requested protection scope
17+
type: array
18+
items:
19+
$ref: '#/ScopeItem'
20+
21+
AssetsProtection:
22+
description: 'The list of assets with protection level'
23+
type: array
24+
items:
25+
$ref: '#/AssetProtection'
26+
27+
AssetProtection:
28+
type: object
29+
properties:
30+
type:
31+
$ref: '#/AssetType'
32+
key:
33+
$ref: '#/AssetKey'
34+
protection_level:
35+
$ref: '#/ProtectionLevel'
36+
name:
37+
$ref: '#/AssetName'
38+
cidr_block:
39+
$ref: '#/CidrBlock'
40+
region:
41+
description: The region asset name containing the asset. Informational only.
42+
type: string
43+
network:
44+
description: The vpc/network asset name containing the asset. Informational only.
45+
type: string
46+
cidr_ranges:
47+
description: The network list of CIDRs
48+
type: array
49+
items:
50+
$ref: '#/CidrBlock'
51+
required:
52+
- type
53+
- key
54+
- protection_level
55+
56+
CidrBlock:
57+
type: string
58+
description: The subnet cidr_block
59+
60+
ProtectionLevel:
61+
type: string
62+
enum:
63+
- professional
64+
- essentials
65+
- enterprise
66+
- lm_essentials
67+
- lmpro
68+
- tmpro
69+
- excluded
70+
- inherited
71+
72+
ScopeItem:
73+
type: object
74+
properties:
75+
type:
76+
$ref: '#/AssetType'
77+
key:
78+
$ref: '#/AssetKey'
79+
policy:
80+
description: Protection level policy
81+
type: object
82+
properties:
83+
id:
84+
type: string
85+
enum:
86+
- D12D5E67-166C-474F-87AA-6F86FC9FB9BC
87+
- A8E8B104-8F45-411D-A240-A30EA5FE25B0
88+
- EC735B49-2517-4D98-BB9D-BEBC1E75D56D
89+
- A562D3E4-ECBE-426E-B2CF-78D2336E5D63
90+
- 7E184449-FB15-4693-807F-C01A1ECD7E66
91+
- D2A589A9-EA56-456C-844E-65843B483D68
92+
AssetKey:
93+
type: string
94+
description: Asset key
95+
AssetType:
96+
type: string
97+
description: Asset type
98+
AssetName:
99+
type: string
100+
description: Asset Name

0 commit comments

Comments
 (0)