Skip to content

Commit 3da4a50

Browse files
author
cibot
committed
Definitions Update assets_query
1 parent 7a1eeb4 commit 3da4a50

File tree

4 files changed

+154
-5
lines changed

4 files changed

+154
-5
lines changed

alsdkdefs/apis/assets_query/assets_query.v1.yaml

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,13 +1719,58 @@ paths:
17191719
$ref: 'responses.yaml#/UnavailableError'
17201720
security:
17211721
- x-aims-auth-token: []
1722-
/assets_query/v1/{account_id}/deployments/{deployment_id}/tags/summary:
1722+
/assets_query/v1/{account_id}/tags/summary:
17231723
parameters:
17241724
- $ref: 'parameters.yaml#/UrlParamAccountId'
1725-
- $ref: 'parameters.yaml#/UrlParamDeploymentId'
1725+
- $ref: 'parameters.yaml#/ParamIncludeTaggedAssets'
17261726
get:
17271727
operationId: get_tags_summary
17281728
summary: Get Tags Summary
1729+
description: |-
1730+
Get a summary of all tags, with normalized keys, across all deployments. This endpoint should be
1731+
preferred for use-cases that span deployments, like asset groups.
1732+
tags:
1733+
- Summaries
1734+
responses:
1735+
"200":
1736+
description: OK
1737+
content:
1738+
application/json:
1739+
schema:
1740+
$ref: 'schemas.yaml#/TagsSummaryResponse'
1741+
examples:
1742+
"Get tag summary (tags only)":
1743+
$ref: 'examples.yaml#/TagsSummaryTagsOnlyExample'
1744+
"Get tag summary (with tagged assets)":
1745+
$ref: 'examples.yaml#/TagsSummaryAssetsIncludedExample'
1746+
"401":
1747+
$ref: 'responses.yaml#/Unauthorized'
1748+
"403":
1749+
$ref: 'responses.yaml#/Forbidden'
1750+
"404":
1751+
$ref: 'responses.yaml#/NotFound'
1752+
"503":
1753+
$ref: 'responses.yaml#/UnavailableError'
1754+
x-codeSamples:
1755+
- lang: Shell
1756+
label: Get tag summary (tags only)
1757+
source: |-
1758+
curl "https://api.cloudinsight.alertlogic.com/assets_query/v1/12345678/tags/summary" \
1759+
-H "x-aims-auth-token: $TOKEN" -H "accept: application/json"
1760+
- lang: Shell
1761+
label: Get tag summary (with tagged assets)
1762+
source: |-
1763+
curl "https://api.cloudinsight.alertlogic.com/assets_query/v1/12345678/tags/summary?include_tagged_assets=true" \
1764+
-H "x-aims-auth-token: $TOKEN" -H "accept: application/json"
1765+
security:
1766+
- x-aims-auth-token: [ ]
1767+
/assets_query/v1/{account_id}/deployments/{deployment_id}/tags/summary:
1768+
parameters:
1769+
- $ref: 'parameters.yaml#/UrlParamAccountId'
1770+
- $ref: 'parameters.yaml#/UrlParamDeploymentId'
1771+
get:
1772+
operationId: get_tags_summary_deprecated
1773+
summary: Get Tags Summary (Deprecated)
17291774
description: |-
17301775
Get a summary of all tags in a deployment. Returns a list of (minimal) assets with their
17311776
tags.
@@ -1737,10 +1782,10 @@ paths:
17371782
content:
17381783
application/json:
17391784
schema:
1740-
$ref: 'schemas.yaml#/TagsSummaryResponse'
1785+
$ref: 'schemas.yaml#/TagsSummaryDeprecatedResponse'
17411786
examples:
17421787
Get Tags Summary Example:
1743-
$ref: 'examples.yaml#/TagsSummaryExample'
1788+
$ref: 'examples.yaml#/TagsSummaryDeprecatedExample'
17441789
"401":
17451790
$ref: 'responses.yaml#/Unauthorized'
17461791
"403":

alsdkdefs/apis/assets_query/examples.yaml

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,82 @@ ExposuresSummaryForDeploymentExample:
20152015
info: 19
20162016
low: 5
20172017
medium: 6
2018-
TagsSummaryExample:
2018+
TagsSummaryTagsOnlyExample:
2019+
value:
2020+
tags:
2021+
assets:
2022+
- - tag:/tag/key/base-stack-name/value/integration
2023+
- - tag:/tag/key/department/value/engineering
2024+
rows: 2
2025+
data:
2026+
tag:/tag/key/base-stack-name/value/integration:
2027+
type: tag
2028+
tag_value: integration
2029+
tag_key: base-stack-name
2030+
name: 'base-stack-name: integration'
2031+
key: tag:/tag/key/base-stack-name/value/integration
2032+
deployment_ids:
2033+
- CD7C26C3-FAA1-4AD1-86CB-9628ED1B3327
2034+
tag:/tag/key/department/value/Engineering:
2035+
type: tag
2036+
tag_value: engineering
2037+
tag_key: department
2038+
name: 'department: Engineering'
2039+
key: tag:/tag/key/department/value/Engineering
2040+
deployment_ids:
2041+
- B8CB762A-7675-42FC-9C47-4A7ADF27D3D1
2042+
- CD7C26C3-FAA1-4AD1-86CB-9628ED1B3327
2043+
TagsSummaryAssetsIncludedExample:
2044+
value:
2045+
tags:
2046+
assets:
2047+
- - tag:/tag/key/base-stack-name/value/integration
2048+
- CD7C26C3-FAA1-4AD1-86CB-9628ED1B3327:vpc:vpc-123
2049+
- - tag:/tag/key/department/value/engineering
2050+
- B8CB762A-7675-42FC-9C47-4A7ADF27D3D1:vpc:vpc-123
2051+
- - tag:/tag/key/department/value/engineering
2052+
- CD7C26C3-FAA1-4AD1-86CB-9628ED1B3327:vpc:vpc-456
2053+
rows: 3
2054+
data:
2055+
tag:/tag/key/base-stack-name/value/integration:
2056+
type: tag
2057+
tag_value: integration
2058+
tag_key: base-stack-name
2059+
name: 'base-stack-name: integration'
2060+
key: tag:/tag/key/base-stack-name/value/integration
2061+
deployment_ids:
2062+
- CD7C26C3-FAA1-4AD1-86CB-9628ED1B3327
2063+
tag:/tag/key/department/value/Engineering:
2064+
type: tag
2065+
tag_value: engineering
2066+
tag_key: department
2067+
name: 'department: Engineering'
2068+
key: tag:/tag/key/department/value/Engineering
2069+
deployment_ids:
2070+
- B8CB762A-7675-42FC-9C47-4A7ADF27D3D1
2071+
- CD7C26C3-FAA1-4AD1-86CB-9628ED1B3327
2072+
B8CB762A-7675-42FC-9C47-4A7ADF27D3D1:vpc:vpc-123:
2073+
vpc_id: vpc-123
2074+
type: vpc
2075+
network_uuid: 30A8FE2B-120E-4FA7-B0F8-4709E8910BF5
2076+
name: integration
2077+
modified_on: 1603391219899
2078+
key: vpc-123
2079+
created_on: 1603391219899
2080+
cidr_ranges:
2081+
- 10.0.0.0/8
2082+
CD7C26C3-FAA1-4AD1-86CB-9628ED1B3327:vpc:vpc-456:
2083+
vpc_id: vpc-456
2084+
type: vpc
2085+
network_uuid: 7CE7A439-B86E-434E-8C3C-CA3314BDE6DF
2086+
name: production
2087+
modified_on: 1603391219899
2088+
key: vpc-456
2089+
vpc_name: production
2090+
created_on: 1603391219899
2091+
cidr_ranges:
2092+
- 172.16.0.0/12
2093+
TagsSummaryDeprecatedExample:
20192094
value:
20202095
tags:
20212096
- key: "/aws/us-west-2"

alsdkdefs/apis/assets_query/parameters.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,3 +411,13 @@ ParamTopoChain:
411411
If set to `false`, it will retrieve all matching assets regardless of their topology path.
412412
Note that `topo_chain=false` may include assets with broken path to the response
413413
(e.g. a host without a relationship to a subnet).
414+
ParamIncludeTaggedAssets:
415+
schema:
416+
type: boolean
417+
default: false
418+
in: query
419+
name: include_tagged_assets
420+
description: |-
421+
When true, causes the inclusion of tagged assets in the result.
422+
The single-column rows become two-column rows and the data map includes
423+
tagged assets with keys in the form `deployment_id:type:key`.

alsdkdefs/apis/assets_query/schemas.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,25 @@ TagsSummaryResponse:
521521
tags:
522522
type: object
523523
description: Object containing the tag name as keys and their descriptions as values.
524+
TagsSummaryDeprecatedResponse:
525+
title: Tags summary response
526+
type: object
527+
properties:
528+
tags:
529+
type: array
530+
description: Array of summarized tags objects.
531+
items:
532+
type: object
533+
properties:
534+
key:
535+
$ref: '#/AssetKey'
536+
type:
537+
$ref: '#/AssetType'
538+
deployment_id:
539+
$ref: '#/DeploymentId'
540+
tags:
541+
type: object
542+
description: Object containing the tag name as keys and their descriptions as values.
524543
DisposeRemediationsResponse:
525544
title: Dispose remediations response
526545
type: object

0 commit comments

Comments
 (0)