Skip to content

Commit

Permalink
Merge pull request #423 from linode/dev
Browse files Browse the repository at this point in the history
Release v0.21.0
  • Loading branch information
amisiorek-akamai authored Oct 4, 2023
2 parents 79fb5c7 + 8437fc1 commit 1b7bd89
Show file tree
Hide file tree
Showing 29 changed files with 813 additions and 389 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ name: Run Unit test
jobs:
run-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .ansible/collections/ansible_collections/linode/cloud
steps:
- name: checkout repo
uses: actions/checkout@v3
with:
path: .ansible/collections/ansible_collections/linode/cloud

- name: update packages
run: sudo apt-get update -y
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ tmp
__pycache__/
galaxy.yml
venv
collections
.pytest_cache
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ testall: create-integration-config
./scripts/test_all.sh

unittest:
python -m pytest tests/unit/
ansible-test units --target-python default

create-integration-config:
ifneq ("${LINODE_TOKEN}", "")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Name | Description |
[linode.cloud.domain_list](./docs/modules/domain_list.md)|List and filter on Domains.|
[linode.cloud.event_list](./docs/modules/event_list.md)|List and filter on Linode events.|
[linode.cloud.firewall_list](./docs/modules/firewall_list.md)|List and filter on Firewalls.|
[linode.cloud.image_list](./docs/modules/image_list.md)|List and filter on Linode images.|
[linode.cloud.image_list](./docs/modules/image_list.md)|List and filter on Images.|
[linode.cloud.instance_list](./docs/modules/instance_list.md)|List and filter on Linode Instances.|
[linode.cloud.instance_type_list](./docs/modules/instance_type_list.md)|List and filter on Linode Instance Types.|
[linode.cloud.lke_version_list](./docs/modules/lke_version_list.md)|List Kubernetes versions available for deployment to a Kubernetes cluster.|
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/firewall_device.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Manage Linode Firewall Devices.
|-----------|------|----------|------------------------------------------------------------------------------|
| `firewall_id` | <center>`int`</center> | <center>**Required**</center> | The ID of the Firewall that contains this device. |
| `entity_id` | <center>`int`</center> | <center>**Required**</center> | The ID for this Firewall Device. This will be the ID of the Linode Entity. |
| `entity_type` | <center>`str`</center> | <center>**Required**</center> | The type of Linode Entity. Currently only supports linode. **(Choices: `linode`)** |
| `entity_type` | <center>`str`</center> | <center>**Required**</center> | The type of Linode Entity. Currently only supports linode and nodebalancer. **(Choices: `linode`, `nodebalancer`)** |
| `state` | <center>`str`</center> | <center>**Required**</center> | The desired state of the target. **(Choices: `present`, `absent`)** |

## Return Values
Expand Down
16 changes: 8 additions & 8 deletions docs/modules/image_list.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# image_list

List and filter on Linode images.
List and filter on Images.

- [Examples](#examples)
- [Parameters](#parameters)
Expand Down Expand Up @@ -34,21 +34,21 @@ List and filter on Linode images.
| Field | Type | Required | Description |
|-----------|------|----------|------------------------------------------------------------------------------|
| `order` | <center>`str`</center> | <center>Optional</center> | The order to list events in. **(Choices: `desc`, `asc`; Default: `asc`)** |
| `order_by` | <center>`str`</center> | <center>Optional</center> | The attribute to order events by. |
| [`filters` (sub-options)](#filters) | <center>`list`</center> | <center>Optional</center> | A list of filters to apply to the resulting events. |
| `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 Images in. **(Choices: `desc`, `asc`; Default: `asc`)** |
| `order_by` | <center>`str`</center> | <center>Optional</center> | The attribute to order Images by. |
| [`filters` (sub-options)](#filters) | <center>`list`</center> | <center>Optional</center> | A list of filters to apply to the resulting Images. |
| `count` | <center>`int`</center> | <center>Optional</center> | The number of Images 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://www.linode.com/docs/api/images/#images-list__responses |
| `name` | <center>`str`</center> | <center>**Required**</center> | The name of the field to filter on. Valid filterable fields can be found [here](https://www.linode.com/docs/api/images/#images-list__responses). |
| `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

- `images` - The returned images.
- `images` - The returned Images.

- Sample Response:
```json
Expand All @@ -71,6 +71,6 @@ List and filter on Linode images.
}
]
```
- See the [Linode API response documentation](https://www.linode.com/docs/api/images/#images-list__response-samples) for a list of returned fields
- See the [Linode API response documentation](https://www.linode.com/docs/api/images/#images-list__responses) for a list of returned fields


12 changes: 6 additions & 6 deletions docs/modules/instance_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ Get info about a Linode Instance.
| Field | Type | Required | Description |
|-----------|------|----------|------------------------------------------------------------------------------|
| `id` | <center>`int`</center> | <center>Optional</center> | The unique ID of the instance. Optional if `label` is defined. **(Conflicts With: `label`)** |
| `label` | <center>`str`</center> | <center>Optional</center> | The instance’s label. Optional if `id` is defined. **(Conflicts With: `id`)** |
| `label` | <center>`str`</center> | <center>Optional</center> | The label of the Instance to resolve. |
| `id` | <center>`int`</center> | <center>Optional</center> | The ID of the Instance to resolve. |

## Return Values

- `instance` - The instance description in JSON serialized form.
- `instance` - The returned Instance.

- Sample Response:
```json
Expand Down Expand Up @@ -82,7 +82,7 @@ Get info about a Linode Instance.
- See the [Linode API response documentation](https://www.linode.com/docs/api/linode-instances/#linode-view__responses) for a list of returned fields


- `configs` - A list of configs tied to this Linode Instance.
- `configs` - The returned Configs.

- Sample Response:
```json
Expand Down Expand Up @@ -150,7 +150,7 @@ Get info about a Linode Instance.
- See the [Linode API response documentation](https://www.linode.com/docs/api/linode-instances/#configuration-profile-view__responses) for a list of returned fields


- `disks` - A list of disks tied to this Linode Instance.
- `disks` - The returned Disks.

- Sample Response:
```json
Expand All @@ -169,7 +169,7 @@ Get info about a Linode Instance.
- See the [Linode API response documentation](https://www.linode.com/docs/api/linode-instances/#disk-view__responses) for a list of returned fields


- `networking` - Networking information about this Linode Instance.
- `networking` - The returned Networking Configuration.

- Sample Response:
```json
Expand Down
26 changes: 25 additions & 1 deletion docs/modules/instance_type_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,33 @@ List and filter on Linode Instance Types.
"price": {
"hourly": 0.008,
"monthly": 5
}
},
"region_prices": [
{
"id": "ap-west",
"hourly": 0.02,
"monthly": 20
},
{
"id": "ap-northeast",
"hourly": 0.02,
"monthly": 20
}
]
}
},
"region_prices": [
{
"id": "ap-west",
"hourly": 0.02,
"monthly": 20
},
{
"id": "ap-northeast",
"hourly": 0.02,
"monthly": 20
}
],
"class": "standard",
"disk": 81920,
"gpus": 0,
Expand Down
1 change: 1 addition & 0 deletions docs/modules/nodebalancer.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Manage a Linode NodeBalancer.
| `state` | <center>`str`</center> | <center>**Required**</center> | The desired state of the target. **(Choices: `present`, `absent`)** |
| `client_conn_throttle` | <center>`int`</center> | <center>Optional</center> | Throttle connections per second. Set to 0 (zero) to disable throttling. **(Updatable)** |
| `region` | <center>`str`</center> | <center>Optional</center> | The ID of the Region to create this NodeBalancer in. |
| `firewall_id` | <center>`int`</center> | <center>Optional</center> | The ID of the Firewall to assign this NodeBalancer to. |
| [`configs` (sub-options)](#configs) | <center>`list`</center> | <center>Optional</center> | A list of configs to apply to the NodeBalancer. **(Updatable)** |

### configs
Expand Down
7 changes: 3 additions & 4 deletions docs/modules/stackscript_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ Get info about a Linode StackScript.
| Field | Type | Required | Description |
|-----------|------|----------|------------------------------------------------------------------------------|
| `id` | <center>`int`</center> | <center>Optional</center> | The ID of the StackScript. **(Conflicts With: `label`)** |
| `label` | <center>`str`</center> | <center>Optional</center> | The label of the StackScript. **(Conflicts With: `id`)** |
| `label` | <center>`str`</center> | <center>Optional</center> | The label of the StackScript to resolve. |
| `id` | <center>`int`</center> | <center>Optional</center> | The ID of the StackScript to resolve. |

## Return Values

- `stackscript` - The StackScript in JSON serialized form.
- `stackscript` - The returned StackScript.

- Sample Response:
```json
Expand Down Expand Up @@ -64,6 +64,5 @@ Get info about a Linode StackScript.
"username": "myuser"
}
```
- See the [Linode API response documentation](https://www.linode.com/docs/api/stackscripts/#stackscript-view__response-samples) for a list of returned fields


26 changes: 25 additions & 1 deletion plugins/module_utils/doc_fragments/instance_type_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,33 @@
"price": {
"hourly": 0.008,
"monthly": 5
}
},
"region_prices": [
{
"id": "ap-west",
"hourly": 0.02,
"monthly": 20
},
{
"id": "ap-northeast",
"hourly": 0.02,
"monthly": 20
}
]
}
},
"region_prices": [
{
"id": "ap-west",
"hourly": 0.02,
"monthly": 20
},
{
"id": "ap-northeast",
"hourly": 0.02,
"monthly": 20
}
],
"class": "standard",
"disk": 81920,
"gpus": 0,
Expand Down
7 changes: 7 additions & 0 deletions plugins/module_utils/linode_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
"doc_hide": True,
"fallback": (env_fallback, ["LINODE_UA_PREFIX"]),
},
"ca_path": {
"type": "str",
"description": "A path to a custom certificate authority for using alternate APIs.",
"fallback": (env_fallback, ["LINODE_CA"]),
},
}

LINODE_TAG_ARGS = {
Expand Down Expand Up @@ -241,6 +246,7 @@ def client(self) -> LinodeClient:
api_token = self.module.params["api_token"]
api_version = self.module.params["api_version"]
api_url = self.module.params["api_url"]
ca_path = self.module.params["ca_path"]

user_agent = COLLECTION_USER_AGENT

Expand All @@ -256,6 +262,7 @@ def client(self) -> LinodeClient:
retry_rate_limit_interval=RETRY_INTERVAL_SECONDS,
retry_max=MAX_RETRIES,
retry_statuses=RETRY_STATUSES,
ca_path=ca_path,
)

return self._client
Loading

0 comments on commit 1b7bd89

Please sign in to comment.