Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated NodeBalancer-related info and list modules to new framework #566

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Name | Description |
[linode.cloud.lke_node_pool](./docs/modules/lke_node_pool.md)|Manage Linode LKE cluster node pools.|
[linode.cloud.nodebalancer](./docs/modules/nodebalancer.md)|Manage a Linode NodeBalancer.|
[linode.cloud.nodebalancer_node](./docs/modules/nodebalancer_node.md)|Manage Linode NodeBalancer Nodes.|
[linode.cloud.nodebalancer_stats](./docs/modules/nodebalancer_stats.md)|View a Linode NodeBalancers Stats.|
[linode.cloud.nodebalancer_stats](./docs/modules/nodebalancer_stats.md)|Get info about a Linode Node Balancer Stats.|
[linode.cloud.object_keys](./docs/modules/object_keys.md)|Manage Linode Object Storage Keys.|
[linode.cloud.placement_group](./docs/modules/placement_group.md)|Manage a Linode Placement Group.|
[linode.cloud.placement_group_assign](./docs/modules/placement_group_assign.md)|Manages a single assignment between a Linode and a Placement Group.|
Expand Down Expand Up @@ -69,7 +69,7 @@ Name | Description |
[linode.cloud.ip_info](./docs/modules/ip_info.md)|Get info about a Linode IP.|
[linode.cloud.ipv6_range_info](./docs/modules/ipv6_range_info.md)|Get info about a Linode IPv6 range.|
[linode.cloud.lke_cluster_info](./docs/modules/lke_cluster_info.md)|Get info about a Linode LKE cluster.|
[linode.cloud.nodebalancer_info](./docs/modules/nodebalancer_info.md)|Get info about a Linode NodeBalancer.|
[linode.cloud.nodebalancer_info](./docs/modules/nodebalancer_info.md)|Get info about a Linode Node Balancer.|
[linode.cloud.object_cluster_info](./docs/modules/object_cluster_info.md)|**NOTE: This module has been deprecated because it relies on deprecated API endpoints. Going forward, `region` will be the preferred way to designate where Object Storage resources should be created.**|
[linode.cloud.placement_group_info](./docs/modules/placement_group_info.md)|Get info about a Linode Placement Group.|
[linode.cloud.profile_info](./docs/modules/profile_info.md)|Get info about a Linode Profile.|
Expand Down Expand Up @@ -101,7 +101,7 @@ Name | Description |
[linode.cloud.instance_list](./docs/modules/instance_list.md)|List and filter on Instances.|
[linode.cloud.instance_type_list](./docs/modules/instance_type_list.md)|**NOTE: This module has been deprecated in favor of `type_list`.|
[linode.cloud.lke_version_list](./docs/modules/lke_version_list.md)|List Kubernetes versions available for deployment to a Kubernetes cluster.|
[linode.cloud.nodebalancer_list](./docs/modules/nodebalancer_list.md)|List and filter on Nodebalancers.|
[linode.cloud.nodebalancer_list](./docs/modules/nodebalancer_list.md)|List and filter on Node Balancers.|
[linode.cloud.object_cluster_list](./docs/modules/object_cluster_list.md)|**NOTE: This module has been deprecated because it relies on deprecated API endpoints. Going forward, `region` will be the preferred way to designate where Object Storage resources should be created.**|
[linode.cloud.placement_group_list](./docs/modules/placement_group_list.md)|List and filter on Placement Groups.|
[linode.cloud.region_list](./docs/modules/region_list.md)|List and filter on Linode Regions.|
Expand Down
52 changes: 43 additions & 9 deletions docs/modules/nodebalancer_info.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nodebalancer_info

Get info about a Linode NodeBalancer.
Get info about a Linode Node Balancer.

- [Minimum Required Fields](#minimum-required-fields)
- [Examples](#examples)
Expand Down Expand Up @@ -31,12 +31,12 @@ Get info about a Linode NodeBalancer.

| Field | Type | Required | Description |
|-----------|------|----------|------------------------------------------------------------------------------|
| `id` | <center>`int`</center> | <center>Optional</center> | The ID of this NodeBalancer. Optional if `label` is defined. **(Conflicts With: `label`)** |
| `label` | <center>`str`</center> | <center>Optional</center> | The label of this NodeBalancer. Optional if `id` is defined. **(Conflicts With: `id`)** |
| `label` | <center>`str`</center> | <center>Optional</center> | The label of the Node Balancer to resolve. **(Conflicts With: `id`)** |
| `id` | <center>`int`</center> | <center>Optional</center> | The ID of the Node Balancer to resolve. **(Conflicts With: `label`)** |

## Return Values

- `node_balancer` - The NodeBalancer in JSON serialized form.
- `node_balancer` - The returned Node Balancer.

- Sample Response:
```json
Expand Down Expand Up @@ -64,7 +64,7 @@ Get info about a Linode NodeBalancer.
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-node-balancer) for a list of returned fields


- `configs` - A list of configs applied to the NodeBalancer.
- `configs` - The returned configs.

- Sample Response:
```json
Expand Down Expand Up @@ -96,10 +96,10 @@ Get info about a Linode NodeBalancer.
}
]
```
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-node-balancer-config) for a list of returned fields
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-node-balancer-configs) for a list of returned fields


- `nodes` - A list of configs applied to the NodeBalancer.
- `nodes` - The returned nodes.

- Sample Response:
```json
Expand All @@ -116,10 +116,10 @@ Get info about a Linode NodeBalancer.
}
]
```
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-node-balancer-node) for a list of returned fields
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-node-balancer-config-nodes) for a list of returned fields


- `firewalls` - A list IDs for firewalls attached to this NodeBalancer.
- `firewalls` - The returned firewalls.

- Sample Response:
```json
Expand All @@ -131,3 +131,37 @@ Get info about a Linode NodeBalancer.
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-node-balancer-firewalls) for a list of returned fields


- `firewalls_data` - The returned firewalls_data.

- Sample Response:
```json
[
{
"created": "2020-04-10T13:34:00",
"entities": [
{
"id": 1234,
"label": "example-label",
"type": "nodebalancer",
"url": "/v4/nodebalancers/1234"
}
],
"id": 45678,
"label": "very-cool-label",
"rules": {
"fingerprint": "abcdefg",
"inbound": [],
"inbound_policy": "DROP",
"outbound": [],
"outbound_policy": "DROP",
"version": 1
},
"status": "enabled",
"tags": [],
"updated": "2020-04-10T13:34:01"
}
]
```
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-node-balancer-firewalls) for a list of returned fields


14 changes: 7 additions & 7 deletions docs/modules/nodebalancer_list.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nodebalancer_list

List and filter on Nodebalancers.
List and filter on Node Balancers.

- [Minimum Required Fields](#minimum-required-fields)
- [Examples](#examples)
Expand Down Expand Up @@ -32,21 +32,21 @@ List and filter on Nodebalancers.

| Field | Type | Required | Description |
|-----------|------|----------|------------------------------------------------------------------------------|
| `order` | <center>`str`</center> | <center>Optional</center> | The order to list nodebalancers in. **(Choices: `desc`, `asc`; Default: `asc`)** |
| `order_by` | <center>`str`</center> | <center>Optional</center> | The attribute to order nodebalancers by. |
| [`filters` (sub-options)](#filters) | <center>`list`</center> | <center>Optional</center> | A list of filters to apply to the resulting nodebalancers. |
| `count` | <center>`int`</center> | <center>Optional</center> | The number of results to return. If undefined, all results will be returned. |
| `order` | <center>`str`</center> | <center>Optional</center> | The order to list Node Balancers in. **(Choices: `desc`, `asc`; Default: `asc`)** |
| `order_by` | <center>`str`</center> | <center>Optional</center> | The attribute to order Node Balancers by. |
| [`filters` (sub-options)](#filters) | <center>`list`</center> | <center>Optional</center> | A list of filters to apply to the resulting Node Balancers. |
| `count` | <center>`int`</center> | <center>Optional</center> | The number of Node Balancers 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 attributes can be found here: https://techdocs.akamai.com/linode-api/reference/get-node-balancers |
| `name` | <center>`str`</center> | <center>**Required**</center> | The name of the field to filter on. Valid filterable fields can be found [here](https://techdocs.akamai.com/linode-api/reference/get-node-balancers). |
| `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

- `nodebalancers` - The returned nodebalancers.
- `nodebalancers` - The returned Node Balancers.

- Sample Response:
```json
Expand Down
8 changes: 4 additions & 4 deletions docs/modules/nodebalancer_stats.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nodebalancer_stats

View a Linode NodeBalancers Stats.
Get info about a Linode Node Balancer Stats.

- [Minimum Required Fields](#minimum-required-fields)
- [Examples](#examples)
Expand Down Expand Up @@ -28,12 +28,12 @@ View a Linode NodeBalancers Stats.

| Field | Type | Required | Description |
|-----------|------|----------|------------------------------------------------------------------------------|
| `id` | <center>`int`</center> | <center>Optional</center> | The id of the nodebalancer for which the statistics apply to. **(Conflicts With: `label`)** |
| `label` | <center>`str`</center> | <center>Optional</center> | The label of the nodebalancer for which the statistics apply to. **(Conflicts With: `id`)** |
| `label` | <center>`str`</center> | <center>Optional</center> | The label of the Node Balancer Stats to resolve. **(Conflicts With: `id`)** |
| `id` | <center>`int`</center> | <center>Optional</center> | The ID of the Node Balancer Stats to resolve. **(Conflicts With: `label`)** |

## Return Values

- `node_balancer_stats` - The NodeBalancer Stats in JSON serialized form.
- `node_balancer_stats` - The returned Node Balancer Stats.

- Sample Response:
```json
Expand Down
27 changes: 27 additions & 0 deletions plugins/module_utils/doc_fragments/nodebalancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,30 @@
1234,
5678
]''']

result_firewalls_data_samples = ['''[
{
"created": "2020-04-10T13:34:00",
"entities": [
{
"id": 1234,
"label": "example-label",
"type": "nodebalancer",
"url": "/v4/nodebalancers/1234"
}
],
"id": 45678,
"label": "very-cool-label",
"rules": {
"fingerprint": "abcdefg",
"inbound": [],
"inbound_policy": "DROP",
"outbound": [],
"outbound_policy": "DROP",
"version": 1
},
"status": "enabled",
"tags": [],
"updated": "2020-04-10T13:34:01"
}
]''']
Loading
Loading