-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sdk 1.0] fix tests idea is to adopt SDK 1.0 and AOC 2.0 occasionally reworked of css cluster info module and added dns zone info module. Reviewed-by: Anton Sidelnikov Reviewed-by: Polina Gubina
- Loading branch information
1 parent
4338847
commit 12c8558
Showing
11 changed files
with
159 additions
and
44 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace: opentelekomcloud | ||
name: cloud | ||
version: 0.12.4 | ||
version: 0.13.1 | ||
readme: README.md | ||
authors: | ||
- Artem Goncharov <[email protected]> | ||
|
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,116 @@ | ||
#!/usr/bin/python | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
DOCUMENTATION = ''' | ||
module: dns_zone_info | ||
short_description: Get DNS Zones info | ||
extends_documentation_fragment: opentelekomcloud.cloud.otc | ||
version_added: "0.13.1" | ||
author: "Vladimir Vshivkov (@vladimirvshivkov)" | ||
description: | ||
- Get DNS Zones info from the OTC. | ||
options: | ||
name: | ||
description: | ||
- Zone Name | ||
type: str | ||
required: true | ||
zone_type: | ||
description: | ||
- Zone Type, either public or private | ||
type: str | ||
requirements: ["openstacksdk", "otcextensions"] | ||
''' | ||
|
||
RETURN = ''' | ||
zone: | ||
description: Modify DNS Zones | ||
type: complex | ||
returned: On Success. | ||
contains: | ||
description: | ||
description: Description of the Zone | ||
type: str | ||
sample: "MyZone123" | ||
email: | ||
description: assigned E-Mail of the Zone | ||
type: str | ||
sample: "[email protected]" | ||
id: | ||
description: Zone ID | ||
type: str | ||
sample: "fe80804323f2065d0175980e81617c10" | ||
name: | ||
description: Name of the zone | ||
type: str | ||
sample: "test.test2." | ||
router: | ||
description: Assigned VPC | ||
type: list | ||
sample: "[ | ||
router_id: 79c32783-e560-4e3a-95b1-5a0756441e12, | ||
router_region: eu-de, | ||
status: PENDING_CREATE | ||
]" | ||
status: | ||
description: Resource status | ||
type: str | ||
sample: "PENDING_CREATE" | ||
ttl: | ||
description: Cache duration (in second) on a local DNS server | ||
type: int | ||
sample: 300 | ||
zone_type: | ||
description: Zone Type, either public or private | ||
type: str | ||
sample: "private" | ||
''' | ||
|
||
EXAMPLES = ''' | ||
# Get a Zone: | ||
- name: Testing | ||
opentelekomcloud.cloud.dns_zone_info: | ||
name: "test.com." | ||
zone_type: private | ||
''' | ||
|
||
from ansible_collections.opentelekomcloud.cloud.plugins.module_utils.otc import OTCModule | ||
|
||
|
||
class DNSZonesInfoModule(OTCModule): | ||
argument_spec = dict( | ||
name=dict(required=True), | ||
zone_type=dict() | ||
) | ||
module_kwargs = dict( | ||
supports_check_mode=True | ||
) | ||
|
||
def run(self): | ||
query = { | ||
'type': self.params['zone_type'], | ||
'name_or_id': self.params['name'] | ||
} | ||
|
||
zone = self.conn.dns.find_zone(**query) | ||
self.exit(changed=True, zone=zone.to_dict()) | ||
|
||
|
||
def main(): | ||
module = DNSZonesInfoModule() | ||
module() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
ansible | ||
ansible==7.2.0 | ||
ansible-lint | ||
openstacksdk | ||
pycodestyle==2.6.0 | ||
pycodestyle==2.10.0 | ||
flake8==3.8.4 | ||
pylint | ||
voluptuous | ||
voluptuous==0.13.1 | ||
yamllint | ||
rstcheck | ||
ruamel.yaml | ||
tox | ||
otcextensions | ||
otcextensions==0.29 |
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 |
---|---|---|
|
@@ -8,4 +8,4 @@ voluptuous | |
yamllint | ||
rstcheck | ||
ruamel.yaml | ||
otcextensions>=0.10.0 | ||
otcextensions==0.29 |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
otcextensions<=0.26.3 | ||
openstacksdk<=0.61.0 | ||
otcextensions | ||
openstacksdk |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
deh/group1 | ||
disabled |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
openstacksdk | ||
otcextensions >= 0.7.1 | ||
otcextensions |