-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #506 from linode/dev
v0.25.8
- Loading branch information
Showing
16 changed files
with
557 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ansible_linode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# vpc_ip_list | ||
|
||
List and filter on VPC IP Addresses. | ||
|
||
- [Minimum Required Fields](#minimum-required-fields) | ||
- [Examples](#examples) | ||
- [Parameters](#parameters) | ||
- [Return Values](#return-values) | ||
|
||
## Minimum Required Fields | ||
| Field | Type | Required | Description | | ||
|-------------|-------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `api_token` | `str` | **Required** | The Linode account personal access token. It is necessary to run the module. <br/>It can be exposed by the environment variable `LINODE_API_TOKEN` instead. <br/>See details in [Usage](https://github.com/linode/ansible_linode?tab=readme-ov-file#usage). | | ||
|
||
## Examples | ||
|
||
```yaml | ||
- name: List all IPs of a specific VPC. | ||
linode.cloud.vpc_ip_list: | ||
vpc_id: 12345 | ||
``` | ||
## Parameters | ||
| Field | Type | Required | Description | | ||
|-----------|------|----------|------------------------------------------------------------------------------| | ||
| `vpc_id` | <center>`int`</center> | <center>**Required**</center> | The parent VPC for the VPC IP Addresses. | | ||
| `order` | <center>`str`</center> | <center>Optional</center> | The order to list VPC IP Addresses in. **(Choices: `desc`, `asc`; Default: `asc`)** | | ||
| `order_by` | <center>`str`</center> | <center>Optional</center> | The attribute to order VPC IP Addresses by. | | ||
| [`filters` (sub-options)](#filters) | <center>`list`</center> | <center>Optional</center> | A list of filters to apply to the resulting VPC IP Addresses. | | ||
| `count` | <center>`int`</center> | <center>Optional</center> | The number of VPC IP Addresses to return. If undefined, all results will be returned. | | ||
|
||
### filters | ||
|
||
| Field | Type | Required | Description | | ||
|-----------|------|----------|------------------------------------------------------------------------------| | ||
| `name` | <center>`str`</center> | <center>**Required**</center> | The name of the field to filter on. Valid filterable fields can be found [here](). | | ||
| `values` | <center>`list`</center> | <center>**Required**</center> | A list of values to allow for this field. Fields will pass this filter if at least one of these values matches. | | ||
|
||
## Return Values | ||
|
||
- `vpcs_ips` - The returned VPC IP Addresses. | ||
|
||
- Sample Response: | ||
```json | ||
[ | ||
{ | ||
"address": "10.0.0.2", | ||
"address_range": null, | ||
"vpc_id": 56242, | ||
"subnet_id": 55829, | ||
"region": "us-mia", | ||
"linode_id": 57328104, | ||
"config_id": 60480976, | ||
"interface_id": 1373818, | ||
"active": false, | ||
"nat_1_1": null, | ||
"gateway": "10.0.0.1", | ||
"prefix": 24, | ||
"subnet_mask": "255.255.255.0", | ||
} | ||
] | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# vpcs_ip_list | ||
|
||
List and filter on all VPC IP Addresses. | ||
|
||
- [Minimum Required Fields](#minimum-required-fields) | ||
- [Examples](#examples) | ||
- [Parameters](#parameters) | ||
- [Return Values](#return-values) | ||
|
||
## Minimum Required Fields | ||
| Field | Type | Required | Description | | ||
|-------------|-------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `api_token` | `str` | **Required** | The Linode account personal access token. It is necessary to run the module. <br/>It can be exposed by the environment variable `LINODE_API_TOKEN` instead. <br/>See details in [Usage](https://github.com/linode/ansible_linode?tab=readme-ov-file#usage). | | ||
|
||
## Examples | ||
|
||
```yaml | ||
- name: List all IPs of all VPCs in the account. | ||
linode.cloud.vpcs_ip_list: {} | ||
``` | ||
## Parameters | ||
| Field | Type | Required | Description | | ||
|-----------|------|----------|------------------------------------------------------------------------------| | ||
| `order` | <center>`str`</center> | <center>Optional</center> | The order to list all VPC IP Addresses in. **(Choices: `desc`, `asc`; Default: `asc`)** | | ||
| `order_by` | <center>`str`</center> | <center>Optional</center> | The attribute to order all VPC IP Addresses by. | | ||
| [`filters` (sub-options)](#filters) | <center>`list`</center> | <center>Optional</center> | A list of filters to apply to the resulting all VPC IP Addresses. | | ||
| `count` | <center>`int`</center> | <center>Optional</center> | The number of all VPC IP Addresses to return. If undefined, all results will be returned. | | ||
|
||
### filters | ||
|
||
| Field | Type | Required | Description | | ||
|-----------|------|----------|------------------------------------------------------------------------------| | ||
| `name` | <center>`str`</center> | <center>**Required**</center> | The name of the field to filter on. Valid filterable fields can be found [here](). | | ||
| `values` | <center>`list`</center> | <center>**Required**</center> | A list of values to allow for this field. Fields will pass this filter if at least one of these values matches. | | ||
|
||
## Return Values | ||
|
||
- `vpcs_ips` - The returned all VPC IP Addresses. | ||
|
||
- Sample Response: | ||
```json | ||
[ | ||
{ | ||
"address": "10.0.0.2", | ||
"address_range": null, | ||
"vpc_id": 56242, | ||
"subnet_id": 55829, | ||
"region": "us-mia", | ||
"linode_id": 57328104, | ||
"config_id": 60480976, | ||
"interface_id": 1373818, | ||
"active": false, | ||
"nat_1_1": null, | ||
"gateway": "10.0.0.1", | ||
"prefix": 24, | ||
"subnet_mask": "255.255.255.0", | ||
} | ||
] | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""Documentation fragments for the vpc_ip_list module""" | ||
|
||
specdoc_examples = [""" | ||
- name: List all IPs of a specific VPC. | ||
linode.cloud.vpc_ip_list: | ||
vpc_id: 12345""", | ||
] | ||
|
||
result_vpc_ip_view_samples = [ | ||
"""[ | ||
{ | ||
"address": "10.0.0.2", | ||
"address_range": null, | ||
"vpc_id": 56242, | ||
"subnet_id": 55829, | ||
"region": "us-mia", | ||
"linode_id": 57328104, | ||
"config_id": 60480976, | ||
"interface_id": 1373818, | ||
"active": false, | ||
"nat_1_1": null, | ||
"gateway": "10.0.0.1", | ||
"prefix": 24, | ||
"subnet_mask": "255.255.255.0", | ||
} | ||
]""" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""Documentation fragments for the vpcs_ip_list module""" | ||
|
||
specdoc_examples = [ | ||
""" | ||
- name: List all IPs of all VPCs in the account. | ||
linode.cloud.vpcs_ip_list: {}""", | ||
] | ||
|
||
result_vpc_samples = [""" | ||
[ | ||
{ | ||
"address": "10.0.0.2", | ||
"address_range": null, | ||
"vpc_id": 56242, | ||
"subnet_id": 55829, | ||
"region": "us-mia", | ||
"linode_id": 57328104, | ||
"config_id": 60480976, | ||
"interface_id": 1373818, | ||
"active": false, | ||
"nat_1_1": null, | ||
"gateway": "10.0.0.1", | ||
"prefix": 24, | ||
"subnet_mask": "255.255.255.0", | ||
} | ||
]""" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
|
||
"""This module contains all of the functionality for listing IP addresses of a VPC.""" | ||
|
||
from __future__ import absolute_import, division, print_function | ||
|
||
import ansible_collections.linode.cloud.plugins.module_utils.doc_fragments.vpc_ip_list as docs | ||
from ansible_collections.linode.cloud.plugins.module_utils.linode_common_list import ( | ||
ListModule, | ||
ListModuleParam, | ||
) | ||
from ansible_specdoc.objects import FieldType | ||
|
||
module = ListModule( | ||
result_display_name="VPC IP Addresses", | ||
result_field_name="vpcs_ips", | ||
endpoint_template="/vpcs/{vpc_id}/ips", | ||
result_docs_url="", | ||
examples=docs.specdoc_examples, | ||
result_samples=docs.result_vpc_ip_view_samples, | ||
params=[ | ||
ListModuleParam( | ||
display_name="VPC", | ||
name="vpc_id", | ||
type=FieldType.integer, | ||
) | ||
], | ||
) | ||
|
||
|
||
SPECDOC_META = module.spec | ||
|
||
if __name__ == "__main__": | ||
module.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
|
||
"""This module contains all of the functionality for listing IP addresses of all VPCs.""" | ||
|
||
from __future__ import absolute_import, division, print_function | ||
|
||
import ansible_collections.linode.cloud.plugins.module_utils.doc_fragments.vpcs_ip_list as docs | ||
from ansible_collections.linode.cloud.plugins.module_utils.linode_common_list import ( | ||
ListModule, | ||
) | ||
|
||
module = ListModule( | ||
result_display_name="all VPC IP Addresses", | ||
result_field_name="vpcs_ips", | ||
endpoint_template="/vpcs/ips", | ||
result_docs_url="", | ||
examples=docs.specdoc_examples, | ||
result_samples=docs.result_vpc_samples, | ||
) | ||
|
||
|
||
SPECDOC_META = module.spec | ||
|
||
if __name__ == "__main__": | ||
module.run() |
Oops, something went wrong.