devices
Creates, updates, deletes, gets or lists a devices resource.
Overview
| Name | devices |
| Type | Resource |
| Id | aws.networkmanager.devices |
Fields
The following fields are returned by SELECT queries:
- get_devices
| Name | Datatype | Description |
|---|---|---|
aws_location | object | Specifies a location in Amazon Web Services. |
created_at | string (date-time) | The date and time that the site was created. |
description | string | The description of the device. (pattern: <code>[\s\S]*</code>) |
device_arn | string | The Amazon Resource Name (ARN) of the device. (pattern: <code>[\s\S]*</code>) |
device_id | string | The ID of the device. (pattern: <code>[\s\S]*</code>) |
global_network_id | string | The ID of the global network. (pattern: <code>[\s\S]*</code>) |
location | object | Describes a location. |
model | string | The device model. (pattern: <code>[\s\S]*</code>) |
serial_number | string | The device serial number. (pattern: <code>[\s\S]*</code>) |
site_id | string | The site ID. (pattern: <code>[\s\S]*</code>) |
state | string | The device state. (PENDING, AVAILABLE, DELETING, UPDATING) |
tags | array | The tags for the device. |
type | string | The device type. (pattern: <code>[\s\S]*</code>) |
vendor | string | The device vendor. (pattern: <code>[\s\S]*</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_devices | select | global_network_id, region | deviceIds, siteId, maxResults, nextToken | Gets information about one or more of your devices in a global network. |
create_device | insert | global_network_id, region | Creates a new device in a global network. If you specify both a site ID and a location, the location of the site is used for visualization in the Network Manager console. | |
update_device | update | global_network_id, device_id, region | Updates the details for an existing device. To remove information for any of the parameters, specify an empty string. | |
delete_device | delete | global_network_id, device_id, region | Deletes an existing device. You must first disassociate the device from any links and customer gateways. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
device_id | string | The ID of the device. |
global_network_id | string | The ID of the global network. |
region | string | AWS region (default: us-east-1) |
deviceIds | array | One or more device IDs. The maximum is 10. |
maxResults | integer | The maximum number of results to return. |
nextToken | string | The token for the next page of results. |
siteId | string | The ID of the site. |
SELECT examples
- get_devices
Gets information about one or more of your devices in a global network.
SELECT
aws_location,
created_at,
description,
device_arn,
device_id,
global_network_id,
location,
model,
serial_number,
site_id,
state,
tags,
type,
vendor
FROM aws.networkmanager.devices
WHERE global_network_id = '{{ global_network_id }}' -- required
AND region = '{{ region }}' -- required
AND deviceIds = '{{ deviceIds }}'
AND siteId = '{{ siteId }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_device
- Manifest
Creates a new device in a global network. If you specify both a site ID and a location, the location of the site is used for visualization in the Network Manager console.
INSERT INTO aws.networkmanager.devices (
AWSLocation,
Description,
Type,
Vendor,
Model,
SerialNumber,
Location,
SiteId,
Tags,
global_network_id,
region
)
SELECT
'{{ AWSLocation }}',
'{{ Description }}',
'{{ Type }}',
'{{ Vendor }}',
'{{ Model }}',
'{{ SerialNumber }}',
'{{ Location }}',
'{{ SiteId }}',
'{{ Tags }}',
'{{ global_network_id }}',
'{{ region }}'
RETURNING
device
;
# Description fields are for documentation purposes
- name: devices
props:
- name: global_network_id
value: "{{ global_network_id }}"
description: Required parameter for the devices resource.
- name: region
value: "{{ region }}"
description: Required parameter for the devices resource.
- name: AWSLocation
description: |
Specifies a location in Amazon Web Services.
value:
Zone: "{{ Zone }}"
SubnetArn: "{{ SubnetArn }}"
- name: Description
value: "{{ Description }}"
- name: Type
value: "{{ Type }}"
- name: Vendor
value: "{{ Vendor }}"
- name: Model
value: "{{ Model }}"
- name: SerialNumber
value: "{{ SerialNumber }}"
- name: Location
description: |
Describes a location.
value:
Address: "{{ Address }}"
Latitude: "{{ Latitude }}"
Longitude: "{{ Longitude }}"
- name: SiteId
value: "{{ SiteId }}"
- name: Tags
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_device
Updates the details for an existing device. To remove information for any of the parameters, specify an empty string.
UPDATE aws.networkmanager.devices
SET
AWSLocation = '{{ AWSLocation }}',
Description = '{{ Description }}',
Type = '{{ Type }}',
Vendor = '{{ Vendor }}',
Model = '{{ Model }}',
SerialNumber = '{{ SerialNumber }}',
Location = '{{ Location }}',
SiteId = '{{ SiteId }}'
WHERE
global_network_id = '{{ global_network_id }}' --required
AND device_id = '{{ device_id }}' --required
AND region = '{{ region }}' --required
RETURNING
device;
DELETE examples
- delete_device
Deletes an existing device. You must first disassociate the device from any links and customer gateways.
DELETE FROM aws.networkmanager.devices
WHERE global_network_id = '{{ global_network_id }}' --required
AND device_id = '{{ device_id }}' --required
AND region = '{{ region }}' --required
;