Skip to content

Commit

Permalink
Sync bitbucket and GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
carchi8py committed Mar 2, 2022
1 parent b585fac commit 4e8d359
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 57 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ NetApp CloudManager Collection Release Notes
.. contents:: Topics


v21.15.0
========

Minor Changes
-------------

- Add the description of client_id based on the cloudmanager UI.
- Set license_type default value 'capacity-paygo' for single node 'ha-capacity-paygo' for HA and 'capacity_package_name' value 'Essential'

v21.14.0
========

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ https://github.com/ansible-collections/netapp/wiki

### Minor Changes
- Add the description of the client_id based on the cloudmanager UI.
- Update ``license_type`` and ``capacity_package_name`` default values on capacity based license.

## 21.14.0

Expand Down
10 changes: 10 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ releases:
- DEVOPS-4516.yaml
- DEVOPS-4563.yaml
release_date: '2022-02-02'
21.15.0:
changes:
minor_changes:
- Add the description of client_id based on the cloudmanager UI.
- Set license_type default value 'capacity-paygo' for single node 'ha-capacity-paygo'
for HA and 'capacity_package_name' value 'Essential'
fragments:
- DEVOPS-4647.yaml
- DEVOPS-4703.yaml
release_date: '2022-03-02'
21.3.0:
modules:
- description: NetApp Cloud Manager Aggregate
Expand Down
2 changes: 1 addition & 1 deletion changelogs/fragments/DEVOPS-4647.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
minor_changes:
- Add the descriptioin of client_id based on the cloudmanager UI.
- Add the description of client_id based on the cloudmanager UI.
2 changes: 2 additions & 0 deletions changelogs/fragments/DEVOPS-4703.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- Set license_type default value 'capacity-paygo' for single node 'ha-capacity-paygo' for HA and 'capacity_package_name' value 'Essential'
30 changes: 14 additions & 16 deletions plugins/modules/na_cloudmanager_cvo_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@
license_type:
description:
- The type of license to use.
- For single node ['cot-explore-paygo','cot-standard-paygo', 'cot-premium-paygo', 'cot-premium-byol', \
'capacity-paygo'].
- For HA ['ha-cot-explore-paygo','ha-cot-standard-paygo','ha-cot-premium-paygo','ha-cot-premium-byol', \
'ha-capacity-paygo'].
- Use capacity-paygo or ha-capacity-paygo for HA on selecting Bring Your Own License type Capacity-Based or Freemium.
- Use cot-premium-boyl or ha-cot-permium-boyl for HA on selecting Bring Your Own License type Node-Based.
choices: ['cot-standard-paygo', 'cot-premium-paygo', 'cot-explore-paygo', 'cot-premium-byol', \
'ha-cot-standard-paygo', 'ha-cot-premium-paygo', 'ha-cot-premium-byol', 'ha-cot-explore-paygo', 'capacity-paygo', \
- For single node ['capacity-paygo', 'cot-explore-paygo', 'cot-standard-paygo', 'cot-premium-paygo', \
'cot-premium-byol'].
- For HA ['ha-capacity-paygo', 'ha-cot-explore-paygo','ha-cot-standard-paygo','ha-cot-premium-paygo', \
'ha-cot-premium-byol'].
- Use capacity-paygo for single node, or ha-capacity-paygo for HA on selecting Capacity-Based license.
- Use cot-premium-boyl or ha-cot-permium-boyl for HA on selecting type Node-Based.
choices: ['capacity-paygo', 'cot-standard-paygo', 'cot-premium-paygo', 'cot-explore-paygo', 'cot-premium-byol', \
'ha-cot-standard-paygo', 'ha-cot-premium-paygo', 'ha-cot-premium-byol', 'ha-cot-explore-paygo', \
'ha-capacity-paygo']
default: cot-standard-paygo
default: capacity-paygo
type: str
provided_license:
Expand All @@ -73,6 +73,7 @@
- Essential only available with Bring Your Own License Capacity-Based.
- Professional available as an annual contract from AWS marketplace or Bring Your Own License Capacity-Based.
choices: ['Professional', 'Essential', 'Freemium']
default: 'Essential'
type: str
version_added: 21.12.0
Expand Down Expand Up @@ -455,7 +456,7 @@ def __init__(self):
name=dict(required=True, type='str'),
state=dict(required=False, choices=['present', 'absent'], default='present'),
instance_type=dict(required=False, type='str', default='m5.2xlarge'),
license_type=dict(required=False, type='str', choices=AWS_License_Types, default='cot-standard-paygo'),
license_type=dict(required=False, type='str', choices=AWS_License_Types, default='capacity-paygo'),
workspace_id=dict(required=False, type='str'),
subnet_id=dict(required=False, type='str'),
vpc_id=dict(required=False, type='str'),
Expand All @@ -468,7 +469,7 @@ def __init__(self):
ontap_version=dict(required=False, type='str', default='latest'),
use_latest_version=dict(required=False, type='bool', default=True),
platform_serial_number=dict(required=False, type='str'),
capacity_package_name=dict(required=False, type='str', choices=['Professional', 'Essential', 'Freemium']),
capacity_package_name=dict(required=False, type='str', choices=['Professional', 'Essential', 'Freemium'], default='Essential'),
provided_license=dict(required=False, type='str'),
tier_level=dict(required=False, type='str', choices=['normal', 'ia', 'ia-single', 'intelligent'], default='normal'),
nss_account=dict(required=False, type='str'),
Expand Down Expand Up @@ -771,11 +772,8 @@ def validate_cvo_params(self):
self.module.fail_json(msg="both platform_serial_number_node1 and platform_serial_number_node2 parameters are required"
"when having ha type as true and license_type as ha-cot-premium-byol")

if self.parameters.get('capacity_package_name') is not None:
if self.parameters['is_ha'] is True and self.parameters['license_type'] != 'ha-capacity-paygo':
self.module.fail_json(msg="license_type value must be ha-capacity-paygo")
if self.parameters['is_ha'] is False and self.parameters['license_type'] != 'capacity-paygo':
self.module.fail_json(msg="license_type value must be capacity-paygo")
if self.parameters['is_ha'] is True and self.parameters['license_type'] == 'capacity-paygo':
self.parameters['license_type'] == 'ha-capacity-paygo'

def apply(self):
"""
Expand Down
21 changes: 9 additions & 12 deletions plugins/modules/na_cloudmanager_cvo_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@
'azure-cot-premium-byol', 'capacity-paygo']
- For HA ['azure-ha-cot-standard-paygo', 'azure-ha-cot-premium-paygo', 'azure-ha-cot-premium-byol', \
'ha-capacity-paygo']
- Use capacity-paygo or ha-capacity-paygo for HA on selecting Bring Your Own License type Capacity-Based or Freemium.
- Use azure-cot-premium-boyl or azure-ha-cot-permium-boyl for HA on selecting Bring Your Own License type Node-Based.
- Use capacity-paygo for single node or ha-capacity-paygo for HA on selecting type Capacity-Based or Freemium.
- Use azure-cot-premium-boyl or azure-ha-cot-permium-boyl for HA on selecting type Node-Based.
choices: ['azure-cot-standard-paygo', 'azure-cot-premium-paygo', 'azure-cot-premium-byol', \
'azure-cot-explore-paygo', 'azure-ha-cot-standard-paygo', 'azure-ha-cot-premium-paygo', \
'azure-ha-cot-premium-byol', 'capacity-paygo', 'ha-capacity-paygo']
default: 'azure-cot-standard-paygo'
default: 'capacity-paygo'
type: str
provided_license:
Expand All @@ -80,6 +80,7 @@
- Essential only available with Bring Your Own License Capacity-Based.
- Professional available as an annual contract from a cloud provider or Bring Your Own License Capacity-Based.
choices: ['Professional', 'Essential', 'Freemium']
default: 'Essential'
type: str
version_added: 21.12.0
Expand Down Expand Up @@ -123,7 +124,7 @@
cidr:
required: true
description:
- The CIDR of the VNET.
- The CIDR of the VNET. If not provided, resource needs az login to authorize and fetch the cidr details from Azure.
type: str
location:
Expand Down Expand Up @@ -380,9 +381,9 @@ def __init__(self):
name=dict(required=True, type='str'),
state=dict(required=False, choices=['present', 'absent'], default='present'),
instance_type=dict(required=False, type='str', default='Standard_DS4_v2'),
license_type=dict(required=False, type='str', choices=AZURE_License_Types, default='azure-cot-standard-paygo'),
license_type=dict(required=False, type='str', choices=AZURE_License_Types, default='capacity-paygo'),
workspace_id=dict(required=False, type='str'),
capacity_package_name=dict(required=False, type='str', choices=['Professional', 'Essential', 'Freemium']),
capacity_package_name=dict(required=False, type='str', choices=['Professional', 'Essential', 'Freemium'], default='Essential'),
provided_license=dict(required=False, type='str'),
subnet_id=dict(required=True, type='str'),
vnet_id=dict(required=True, type='str'),
Expand Down Expand Up @@ -646,12 +647,8 @@ def validate_cvo_params(self):
if self.parameters.get('platform_serial_number_node1') is None or self.parameters.get('platform_serial_number_node2') is None:
self.module.fail_json(msg="both platform_serial_number_node1 and platform_serial_number_node2 parameters are required"
"when having ha type as true and license_type as azure-ha-cot-premium-byol")

if self.parameters.get('capacity_package_name') is not None:
if self.parameters['is_ha'] is True and self.parameters['license_type'] != 'ha-capacity-paygo':
self.module.fail_json(msg="license_type value must be ha-capacity-paygo")
if self.parameters['is_ha'] is False and self.parameters['license_type'] != 'capacity-paygo':
self.module.fail_json(msg="license_type value must be capacity-paygo")
if self.parameters['is_ha'] is True and self.parameters['license_type'] == 'capacity-paygo':
self.parameters['license_type'] == 'ha-capacity-paygo'

def apply(self):
"""
Expand Down
32 changes: 14 additions & 18 deletions plugins/modules/na_cloudmanager_cvo_gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,17 @@
license_type:
description:
- The type of license to use.
- Single node ['gcp-cot-explore-paygo', 'gcp-cot-standard-paygo', 'gcp-cot-premium-paygo', 'gcp-cot-premium-byol', \
'capacity-paygo'].
- HA ['gcp-ha-cot-explore-paygo', 'gcp-ha-cot-standard-paygo', 'gcp-ha-cot-premium-paygo', 'gcp-cot-premium-byol', \
'ha-capacity-paygo'].
- Use capacity-paygo or ha-capacity-paygo for HA on selecting Bring Your Own License type Capacity-Based or Freemium.
- Use gcp-cot-premium-boyl or gcp-ha-cot-permium-boyl for HA on selecting Bring Your Own License type Node-Based.
- Single node ['capacity-paygo', 'gcp-cot-explore-paygo', 'gcp-cot-standard-paygo', 'gcp-cot-premium-paygo', \
'gcp-cot-premium-byol'].
- HA ['ha-capacity-paygo', 'gcp-ha-cot-explore-paygo', 'gcp-ha-cot-standard-paygo', 'gcp-ha-cot-premium-paygo', \
'gcp-cot-premium-byol'].
- Use capacity-paygo or ha-capacity-paygo for HA on selecting type Capacity-Based or Freemium.
- Use gcp-cot-premium-boyl or gcp-ha-cot-permium-boyl for HA on selecting type Node-Based.
choices: ['gcp-cot-standard-paygo', 'gcp-cot-explore-paygo', 'gcp-cot-premium-paygo', 'gcp-cot-premium-byol', \
'gcp-ha-cot-standard-paygo', 'gcp-ha-cot-premium-paygo', 'gcp-ha-cot-explore-paygo', 'gcp-ha-cot-premium-byol', \
'capacity-paygo', 'ha-capacity-paygo']
type: str
default: 'gcp-cot-standard-paygo'
default: 'capacity-paygo'
provided_license:
description:
Expand All @@ -142,9 +142,8 @@
capacity_package_name:
description:
- Capacity package name is required when selecting a capacity based license.
- Essential only available with Bring Your Own License Capacity-Based.
- Professional available as an annual contract from a cloud provider or Bring Your Own License Capacity-Based.
choices: ['Professional', 'Essential', 'Freemium']
default: 'Essential'
type: str
version_added: 21.12.0
Expand Down Expand Up @@ -381,7 +380,7 @@
svm_password: "{{ xxxxxxxxxxxxxxx }}"
ontap_version: latest
use_latest_version: true
license_type: gcp-cot-standard-paygo
license_type: capacity-paygo
instance_type: n1-standard-8
client_id: "{{ xxxxxxxxxxxxxxx }}"
workspace_id: "{{ xxxxxxxxxxxxxxx }}"
Expand Down Expand Up @@ -409,7 +408,7 @@
svm_password: "{{ xxxxxxxxxxxxxxx }}"
ontap_version: ONTAP-9.9.0.T1.gcpha
use_latest_version: false
license_type: gcp-ha-cot-explore-paygo
license_type: ha-capacity-paygo
instance_type: custom-4-16384
client_id: "{{ xxxxxxxxxxxxxxx }}"
workspace_id: "{{ xxxxxxxxxxxxxxx }}"
Expand Down Expand Up @@ -475,7 +474,7 @@ def __init__(self):
gcp_volume_type=dict(required=False, choices=['pd-balanced', 'pd-standard', 'pd-ssd'], type='str'),
instance_type=dict(required=False, type='str', default='n1-standard-8'),
is_ha=dict(required=False, type='bool', default=False),
license_type=dict(required=False, type='str', choices=GCP_LICENSE_TYPES, default='gcp-cot-standard-paygo'),
license_type=dict(required=False, type='str', choices=GCP_LICENSE_TYPES, default='capacity-paygo'),
mediator_zone=dict(required=False, type='str'),
name=dict(required=True, type='str'),
network_project_id=dict(required=False, type='str'),
Expand All @@ -497,7 +496,7 @@ def __init__(self):
tier_level=dict(required=False, type='str', choices=['standard', 'nearline', 'coldline'],
default='standard'),
use_latest_version=dict(required=False, type='bool', default=True),
capacity_package_name=dict(required=False, type='str', choices=['Professional', 'Essential', 'Freemium']),
capacity_package_name=dict(required=False, type='str', choices=['Professional', 'Essential', 'Freemium'], default='Essential'),
provided_license=dict(required=False, type='str'),
vpc_id=dict(required=True, type='str'),
vpc0_firewall_rule_name=dict(required=False, type='str'),
Expand Down Expand Up @@ -556,11 +555,8 @@ def create_cvo_gcp(self):
self.module.fail_json(msg)
self.parameters['nss_account'] = response

if self.parameters.get('capacity_package_name') is not None:
if self.parameters['is_ha'] is True and self.parameters['license_type'] != 'ha-capacity-paygo':
self.module.fail_json(msg="license_type value must be ha-capacity-paygo")
if self.parameters['is_ha'] is False and self.parameters['license_type'] != 'capacity-paygo':
self.module.fail_json(msg="license_type value must be capacity-paygo")
if self.parameters['is_ha'] is True and self.parameters['license_type'] == 'capacity-paygo':
self.parameters['license_type'] == 'ha-capacity-paygo'

json = {"name": self.parameters['name'],
"region": self.parameters['zone'],
Expand Down
26 changes: 20 additions & 6 deletions tests/unit/plugins/modules/test_na_cloudmanager_cvo_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def set_default_args_pass_check(self):
'vpc_id': 'vpc-test',
'subnet_id': 'subnet-test',
'svm_password': 'password',
'license_type': 'cot-explore-paygo',
'instance_type': 'm5.xlarge',
'refresh_token': 'myrefresh_token',
'is_ha': False
Expand Down Expand Up @@ -103,6 +102,21 @@ def set_args_delete_cloudmanager_cvo_aws(self):
'is_ha': False
})

def set_args_create_bynode_cloudmanager_cvo_aws(self):
return dict({
'state': 'present',
'name': 'Dummyname',
'client_id': 'test',
'region': 'us-west-1',
'vpc_id': 'vpc-test',
'subnet_id': 'subnet-test',
'svm_password': 'password',
'refresh_token': 'myrefresh_token',
'license_type': 'cot-premium-byol',
'platform_serial_number': '12345678',
'is_ha': False
})

def test_module_fail_when_required_args_missing(self):
''' required arguments are reported as errors '''
with pytest.raises(AnsibleFailJson) as exc:
Expand Down Expand Up @@ -157,6 +171,8 @@ def test_create_cloudmanager_cvo_aws_ha_pass(self, get_post_api, get_working_env
get_tenant, get_vpc, wait_on_completion, get_token):
data = self.set_args_create_cloudmanager_cvo_aws()
data['is_ha'] = True
data['license_type'] = 'ha-capacity-paygo'
data['capacity_package_name'] = 'Essential'
data.pop('subnet_id')
set_module_args(data)
get_token.return_value = 'test', 'test'
Expand Down Expand Up @@ -247,9 +263,7 @@ def test_create_cloudmanager_cvo_aws_ha_capacity_license_pass(self, get_post_api
def test_create_cloudmanager_cvo_aws_nodebase_license_pass(self, get_post_api,
get_working_environment_details_by_name, get_nss,
get_tenant, get_vpc, wait_on_completion, get_token):
data = self.set_args_create_cloudmanager_cvo_aws()
data['license_type'] = 'cot-premium-byol'
data['platform_serial_number'] = '12345678'
data = self.set_args_create_bynode_cloudmanager_cvo_aws()
set_module_args(data)
get_token.return_value = 'test', 'test'
my_obj = my_module()
Expand Down Expand Up @@ -277,7 +291,7 @@ def test_create_cloudmanager_cvo_aws_nodebase_license_pass(self, get_post_api,
def test_create_cloudmanager_cvo_aws_ha_nodebase_license_pass(self, get_post_api,
get_working_environment_details_by_name, get_nss,
get_tenant, get_vpc, wait_on_completion, get_token):
data = self.set_args_create_cloudmanager_cvo_aws()
data = self.set_args_create_bynode_cloudmanager_cvo_aws()
data['license_type'] = 'ha-cot-premium-byol'
data['platform_serial_number_node1'] = '12345678'
data['platform_serial_number_node2'] = '23456789'
Expand Down Expand Up @@ -356,7 +370,7 @@ def test_change_cloudmanager_cvo_aws(self, get_cvo, get_property, get_details, u
'ontapClusterProperties': {
'capacityTierInfo': {'tierLevel': 'normal'},
'licenseType': {'capacityLimit': {'size': 2.0, 'unit': 'TB'},
'name': 'Cloud Volumes ONTAP Explore'},
'name': 'Cloud Volumes ONTAP Capacity Based Charging'},
'ontapVersion': '9.10.0',
'upgradeVersions': [{'autoUpdateAllowed': False,
'imageVersion': 'ONTAP-9.10.1P3',
Expand Down
Loading

0 comments on commit 4e8d359

Please sign in to comment.