Skip to content

Commit

Permalink
Merge pull request linode#574 from linode/main
Browse files Browse the repository at this point in the history
Bring linode#572 to `dev` branch
  • Loading branch information
lgarber-akamai authored Aug 22, 2024
2 parents da6cea0 + a215f01 commit 9f3f30c
Show file tree
Hide file tree
Showing 28 changed files with 64 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ endif

inject:
@echo "Injecting documentation into source files"
for f in `ls ./plugins/modules/*.py`; do ansible-specdoc -j -i $$f; done
for f in `ls ./plugins/modules/*.py`; do echo "$$f" && ansible-specdoc -j -i $$f; done
ansible-test sanity --test ansible-doc

inject-clean:
@echo "Removing injected documentation from source files"
for f in `ls ./plugins/modules/*.py`; do ansible-specdoc -jc -i $$f; done
for f in `ls ./plugins/modules/*.py`; do echo "$$f" && ansible-specdoc -jc -i $$f; done
5 changes: 5 additions & 0 deletions docs/modules/api_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,9 @@ The Linode API documentation can be found here: https://techdocs.akamai.com/lino

- `status` - The response status code.

- Sample Response:
```json
200
```


2 changes: 1 addition & 1 deletion docs/modules/ip_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Get info about a Linode IP.
"vpc_nat_1_1": {
"vpc_id": 242,
"subnet_id": 194,
"address": "139.144.244.36",
"address": "139.144.244.36"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ip_rdns.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Manage a Linode IP address's rDNS.
"vpc_nat_1_1": {
"vpc_id": 242,
"subnet_id": 194,
"address": "139.144.244.36",
"address": "139.144.244.36"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ip_share.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ WARNING! This module makes use of beta endpoints and requires the C(api_version)
[
{
"linode_id": 12345,
"ips": ["192.0.2.1", "2001:db8:3c4d:15::"],
"ips": ["192.0.2.1", "2001:db8:3c4d:15::"]
}
]
```
Expand Down
10 changes: 10 additions & 0 deletions docs/modules/lke_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,20 @@ Manage Linode LKE clusters.

- `kubeconfig` - The Base64-encoded kubeconfig used to access this cluster.
NOTE: This value may be unavailable if `skip_polling` is true.

- Sample Response:
```json
"a3ViZWNvbmZpZyBjb250ZW50Cg=="
```
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-lke-cluster-kubeconfig) for a list of returned fields


- `dashboard_url` - The Cluster Dashboard access URL.

- Sample Response:
```json
"https://example.dashboard.linodelke.net"
```
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-lke-cluster-dashboard) for a list of returned fields


10 changes: 10 additions & 0 deletions docs/modules/lke_cluster_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,20 @@ Get info about a Linode LKE cluster.

- `kubeconfig` - The Base64-encoded kubeconfig used to access this cluster.
NOTE: This value may be unavailable if the cluster is not fully provisioned.

- Sample Response:
```json
"a3ViZWNvbmZpZyBjb250ZW50Cg=="
```
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-lke-cluster-kubeconfig) for a list of returned fields


- `dashboard_url` - The Cluster Dashboard access URL.

- Sample Response:
```json
"https://example.dashboard.linodelke.net"
```
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-lke-cluster-dashboard) for a list of returned fields


2 changes: 1 addition & 1 deletion docs/modules/nodebalancer_stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Get info about a Linode Node Balancer Stats.
1679586600000,
0
]
}
},
"title" : "sample-title"
}
]
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/stackscript_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ List and filter on StackScripts.
"label": "a-stackscript",
"mine": true,
"rev_note": "Set up MySQL",
"script": ""#!/bin/bash"\n",
"script": "\"#!/bin/bash\"\n",
"updated": "2018-01-01T00:01:01",
"user_defined_fields": [
{
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/vpc_ip_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ List and filter on VPC IP Addresses.
"nat_1_1": null,
"gateway": "10.0.0.1",
"prefix": 24,
"subnet_mask": "255.255.255.0",
"subnet_mask": "255.255.255.0"
}
]
```
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/vpc_subnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Create, read, and update a Linode VPC Subnet.
"linodes": [
{
"id": 1234567,
"interfaces": [{"active": false, "id": 654321}],
"interfaces": [{"active": false, "id": 654321}]
}
],
"updated": "2023-08-31T18:53:04"
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/vpc_subnet_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Get info about a Linode VPC Subnet.
"linodes": [
{
"id": 1234567,
"interfaces": [{"active": false, "id": 654321}],
"interfaces": [{"active": false, "id": 654321}]
}
],
"updated": "2023-08-31T18:53:04"
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/vpc_subnet_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ List and filter on VPC Subnets.
"linodes": [
{
"id": 1234567,
"interfaces": [{"active": false, "id": 654321}],
"interfaces": [{"active": false, "id": 654321}]
}
],
"updated": "2023-08-31T18:53:04"
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/vpcs_ip_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ List and filter on all VPC IP Addresses.
"nat_1_1": null,
"gateway": "10.0.0.1",
"prefix": 24,
"subnet_mask": "255.255.255.0",
"subnet_mask": "255.255.255.0"
}
]
```
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/doc_fragments/ip_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"vpc_nat_1_1": {
"vpc_id": 242,
"subnet_id": 194,
"address": "139.144.244.36",
"address": "139.144.244.36"
}
}''']
2 changes: 1 addition & 1 deletion plugins/module_utils/doc_fragments/ip_share.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
result_ip_share_stats_samples = ['''[
{
"linode_id": 12345,
"ips": ["192.0.2.1", "2001:db8:3c4d:15::"],
"ips": ["192.0.2.1", "2001:db8:3c4d:15::"]
}
]''']
2 changes: 1 addition & 1 deletion plugins/module_utils/doc_fragments/nodebalancer_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
1679586600000,
0
]
}
},
"title" : "sample-title"
}
]''']
2 changes: 1 addition & 1 deletion plugins/module_utils/doc_fragments/stackscript_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"label": "a-stackscript",
"mine": true,
"rev_note": "Set up MySQL",
"script": "\"#!/bin/bash\"\\n",
"script": "\\\"#!/bin/bash\\\"\\n",
"updated": "2018-01-01T00:01:01",
"user_defined_fields": [
{
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/doc_fragments/vpc_ip_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"nat_1_1": null,
"gateway": "10.0.0.1",
"prefix": 24,
"subnet_mask": "255.255.255.0",
"subnet_mask": "255.255.255.0"
}
]"""
]
2 changes: 1 addition & 1 deletion plugins/module_utils/doc_fragments/vpc_subnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"linodes": [
{
"id": 1234567,
"interfaces": [{"active": false, "id": 654321}],
"interfaces": [{"active": false, "id": 654321}]
}
],
"updated": "2023-08-31T18:53:04"
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/doc_fragments/vpc_subnet_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"linodes": [
{
"id": 1234567,
"interfaces": [{"active": false, "id": 654321}],
"interfaces": [{"active": false, "id": 654321}]
}
],
"updated": "2023-08-31T18:53:04"
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/doc_fragments/vpcs_ip_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"nat_1_1": null,
"gateway": "10.0.0.1",
"prefix": 24,
"subnet_mask": "255.255.255.0",
"subnet_mask": "255.255.255.0"
}
]"""
]
4 changes: 3 additions & 1 deletion plugins/modules/api_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
sample=docs.result_body_samples,
),
"status": SpecReturnValue(
description="The response status code.", type=FieldType.integer
description="The response status code.",
type=FieldType.integer,
sample=["200"],
),
},
)
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/image_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,12 @@

SPECDOC_META = module.spec

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""

if __name__ == "__main__":
module.run()
9 changes: 4 additions & 5 deletions plugins/modules/instance_type_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@
result_docs_url="https://techdocs.akamai.com/linode-api/reference/get-linode-types",
examples=docs.specdoc_examples,
result_samples=docs.result_instance_type_samples,
description=[
"**NOTE: This module has been deprecated in favor of `type_list`.",
"List and filter on Linode Instance Types.",
],
)

module.description = [
"**NOTE: This module has been deprecated in favor of `type_list`.",
"List and filter on Linode Instance Types.",
]

SPECDOC_META = module.spec

DOCUMENTATION = r"""
Expand Down
2 changes: 2 additions & 0 deletions plugins/modules/lke_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,13 @@
"NOTE: This value may be unavailable if `skip_polling` is true.",
docs_url="https://techdocs.akamai.com/linode-api/reference/get-lke-cluster-kubeconfig",
type=FieldType.string,
sample=['"a3ViZWNvbmZpZyBjb250ZW50Cg=="'],
),
"dashboard_url": SpecReturnValue(
description="The Cluster Dashboard access URL.",
docs_url="https://techdocs.akamai.com/linode-api/reference/get-lke-cluster-dashboard",
type=FieldType.string,
sample=['"https://example.dashboard.linodelke.net"'],
),
},
)
Expand Down
2 changes: 2 additions & 0 deletions plugins/modules/lke_cluster_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@
"fully provisioned.",
docs_url="https://techdocs.akamai.com/linode-api/reference/get-lke-cluster-kubeconfig",
type=FieldType.string,
sample=['"a3ViZWNvbmZpZyBjb250ZW50Cg=="'],
),
"dashboard_url": SpecReturnValue(
description="The Cluster Dashboard access URL.",
docs_url="https://techdocs.akamai.com/linode-api/reference/get-lke-cluster-dashboard",
type=FieldType.string,
sample=['"https://example.dashboard.linodelke.net"'],
),
},
)
Expand Down
1 change: 1 addition & 0 deletions scripts/specdoc_generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ DPATH="${DOCS_PATH:="docs"}"

for f in plugins/modules/*.py
do
echo "$f"
MODULE_NAME="$(basename "$f" .py)"
PYTHONWARNINGS="ignore" ansible-specdoc -i "$f" -f jinja2 -t template/module.md.j2 -o $DPATH/modules/"$MODULE_NAME".md; #> /dev/null || exit 1;
done

0 comments on commit 9f3f30c

Please sign in to comment.