Skip to content

Commit e006af1

Browse files
author
cibot
committed
Definitions Update assets_query
1 parent 020e4f2 commit e006af1

File tree

4 files changed

+79
-1
lines changed

4 files changed

+79
-1
lines changed

alsdkdefs/apis/assets_query/assets_query.v1.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ paths:
428428
- $ref: 'parameters.yaml#/ParamTopoChain'
429429
- $ref: 'parameters.yaml#/ParamScopeBoolean'
430430
- $ref: 'parameters.yaml#/ParamIncludeAlertlogicSecurity'
431+
- $ref: 'parameters.yaml#/ParamContinue'
432+
- $ref: 'parameters.yaml#/ParamPageSize'
431433
get:
432434
operationId: query_assets
433435
summary: Query Assets for Account
@@ -470,6 +472,16 @@ paths:
470472
source: |-
471473
curl "https://api.cloudinsight.alertlogic.com/assets_query/v1/12345678/assets?asset_types=h:host&h.private_ip_addresses=:cidr_match:192.168.0.0/16" \
472474
-H "x-aims-auth-token: $TOKEN" -H "accept: application/json"
475+
- lang: Shell
476+
label: Get all assets for an account ID with pagination
477+
source: |-
478+
curl "https://api.cloudinsight.alertlogic.com/assets_query/v1/12345678/assets?page_size=10" \
479+
-H "x-aims-auth-token: $TOKEN" -H "accept: application/json"
480+
- lang: Shell
481+
label: Get all assets for an account ID with pagination (continue)
482+
source: |-
483+
curl "https://api.cloudinsight.alertlogic.com/assets_query/v1/12345678/assets?continue=EEBBD0DF-B927-411B-B771-247D4C96F9AC" \
484+
-H "x-aims-auth-token: $TOKEN" -H "accept: application/json"
473485
responses:
474486
"200":
475487
description: OK
@@ -496,6 +508,10 @@ paths:
496508
$ref: 'examples.yaml#/QueryAssetsAssetTypesHostCIDRMatchExample'
497509
topo_chain=false:
498510
$ref: 'examples.yaml#/QueryAssetsTopoChainFalseExample'
511+
asset_types=any & page_size=5:
512+
$ref: 'examples.yaml#/QueryAssetsAssetTypesAnyWithPagination'
513+
asset_types=any & continue=EEBBD0DF-B927-411B-B771-247D4C96F9AC:
514+
$ref: 'examples.yaml#/QueryAssetsAssetTypesAnyWithPaginationContinue'
499515
"400":
500516
$ref: 'responses.yaml#/QueryAssetsBadRequestError'
501517
"401":

alsdkdefs/apis/assets_query/examples.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,58 @@ QueryAssetsTopoChainFalseExample:
314314
key: /aws/us-east-1/subnet/subnet-01020304
315315
account_id: "12345678"
316316
rows: 7
317+
QueryAssetsAssetTypesAnyWithPagination:
318+
value:
319+
assets:
320+
- - deployment_id: 1C0EFEC8-7DBE-480D-A025-ECC13DE30AD5
321+
type: host
322+
key: /aws/us-east-1/host/i-1234abcd1234abcd
323+
account_id: "12345678"
324+
- - deployment_id: 9E4B8AAB-5E07-4B46-8E07-AA16D3CA1D03
325+
type: subnet
326+
key: /aws/us-east-1/subnet/subnet-abcd1234
327+
account_id: "12345678"
328+
- - deployment_id: CD7C26C3-FAA1-4AD1-86CB-9628ED1B3327
329+
type: sg
330+
key: /aws/us-east-1/sg/sg-1234abcd
331+
account_id: "12345678"
332+
- - deployment_id: 1C0EFEC8-7DBE-480D-A025-ECC13DE30AD5
333+
type: image
334+
key: /aws/us-east-1/image/ami-abcdef01
335+
account_id: "12345678"
336+
- - deployment_id: CD7C26C3-FAA1-4AD1-86CB-9628ED1B3327
337+
type: subnet
338+
key: /aws/us-east-1/subnet/subnet-01020304
339+
account_id: "12345678"
340+
rows: 5
341+
continue: EEBBD0DF-B927-411B-B771-247D4C96F9AC
342+
total_assets: 14
343+
QueryAssetsAssetTypesAnyWithPaginationContinue:
344+
value:
345+
assets:
346+
- - deployment_id: 1C0EFEC8-7DBE-480D-A025-ECC13DE30AD5
347+
type: host
348+
key: /aws/us-east-1/host/i-1234abcd1234abcd
349+
account_id: "12345678"
350+
- - deployment_id: 9E4B8AAB-5E07-4B46-8E07-AA16D3CA1D03
351+
type: subnet
352+
key: /aws/us-east-1/subnet/subnet-abcd1234
353+
account_id: "12345678"
354+
- - deployment_id: CD7C26C3-FAA1-4AD1-86CB-9628ED1B3327
355+
type: sg
356+
key: /aws/us-east-1/sg/sg-1234abcd
357+
account_id: "12345678"
358+
- - deployment_id: 1C0EFEC8-7DBE-480D-A025-ECC13DE30AD5
359+
type: image
360+
key: /aws/us-east-1/image/ami-abcdef01
361+
account_id: "12345678"
362+
- - deployment_id: CD7C26C3-FAA1-4AD1-86CB-9628ED1B3327
363+
type: subnet
364+
key: /aws/us-east-1/subnet/subnet-01020304
365+
account_id: "12345678"
366+
rows: 5
367+
continue: C446F70F-3E5F-465D-B743-69C28D06EF90
368+
total_assets: 14
317369
FindAssetAgentByUuidExample:
318370
value:
319371
type: agent

alsdkdefs/apis/assets_query/parameters.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,5 +559,5 @@ ParamPageSize:
559559
in: query
560560
name: page_size
561561
description: |-
562-
The number of results to be returned, default is 50. page_size is only valid
562+
The number of results to be returned, maximum is 10000. `page_size` is only valid
563563
on initial calls to GET assets and will have no effect on subsequent calls.

alsdkdefs/apis/assets_query/schemas.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,16 @@ QueryAssetsResponse:
232232
rows:
233233
type: integer
234234
title: the number of rows in the query response
235+
continue:
236+
type: string
237+
title: |-
238+
A UUID to be used for subsequent GET assets calls to get the next set of results.
239+
Only present when there are more rows to paginate through.
240+
total_assets:
241+
type: integer
242+
title: |-
243+
The total number of rows in the assets list.
244+
Only present when there are more rows to paginate through.
235245
required:
236246
- assets
237247
- rows

0 commit comments

Comments
 (0)