diff --git a/ibm_cloud_networking_services/direct_link_apis_v1.py b/ibm_cloud_networking_services/direct_link_apis_v1.py index f73cbda..2893c71 100644 --- a/ibm_cloud_networking_services/direct_link_apis_v1.py +++ b/ibm_cloud_networking_services/direct_link_apis_v1.py @@ -355,19 +355,15 @@ def create_gateway_action(self, :param str id: Direct Link Connect gateway identifier. :param str action: Action request. - :param bool global_: (optional) Required for create_gateway_approve - requests to select the gateway's routing option. Gateways with global - routing (`true`) can connect to networks outside of their associated - region. - :param bool metered: (optional) Required for create_gateway_approve - requests to select the gateway's metered billing option. When `true` - gateway usage is billed per gigabyte. When `false` there is no per - gigabyte usage charge, instead a flat rate is charged for the gateway. + :param bool global_: (optional) Set for create_gateway_approve requests to + select the gateway's routing option. Gateways with global routing (`true`) + can connect to networks outside of their associated region. + :param bool metered: (optional) Set for create_gateway_approve requests to + select the gateway's metered billing option. When `true` gateway usage is + billed per gigabyte. When `false` there is no per gigabyte usage charge, + instead a flat rate is charged for the gateway. :param ResourceGroupIdentity resource_group: (optional) Set for - create_gateway_approve requests to select the gateway's resource group. If - unspecified on create_gateway_approve, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is - used. + create_gateway_approve requests to select the gateway's resource group. :param List[object] updates: (optional) Specify attribute updates being approved or rejected, update_attributes_approve and update_attributes_reject actions must provide an updates field that matches @@ -1099,31 +1095,31 @@ class CrossConnectRouter(): """ Cross Connect Router details. - :attr str router_name: (optional) The name of the Router. + :attr str name: (optional) The name of the Router. :attr int total_connections: (optional) Count of existing Direct Link Dedicated gateways on this router for this account. """ def __init__(self, *, - router_name: str = None, + name: str = None, total_connections: int = None) -> None: """ Initialize a CrossConnectRouter object. - :param str router_name: (optional) The name of the Router. + :param str name: (optional) The name of the Router. :param int total_connections: (optional) Count of existing Direct Link Dedicated gateways on this router for this account. """ - self.router_name = router_name + self.name = name self.total_connections = total_connections @classmethod def from_dict(cls, _dict: Dict) -> 'CrossConnectRouter': """Initialize a CrossConnectRouter object from a json dictionary.""" args = {} - if 'router_name' in _dict: - args['router_name'] = _dict.get('router_name') + if 'name' in _dict: + args['name'] = _dict.get('name') if 'total_connections' in _dict: args['total_connections'] = _dict.get('total_connections') return cls(**args) @@ -1136,8 +1132,8 @@ def _from_dict(cls, _dict): def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'router_name') and self.router_name is not None: - _dict['router_name'] = self.router_name + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name if hasattr(self, 'total_connections') and self.total_connections is not None: _dict['total_connections'] = self.total_connections return _dict @@ -1512,7 +1508,6 @@ class OperationalStatusEnum(str, Enum): AWAITING_COMPLETION_NOTICE = 'awaiting_completion_notice' AWAITING_LOA = 'awaiting_loa' CREATE_PENDING = 'create_pending' - CREATE_REJECTED = 'create_rejected' COMPLETION_NOTICE_APPROVED = 'completion_notice_approved' COMPLETION_NOTICE_RECEIVED = 'completion_notice_received' COMPLETION_NOTICE_REJECTED = 'completion_notice_rejected' @@ -1736,7 +1731,8 @@ class GatewayTemplate(): :attr str name: The unique user-defined name for this gateway. :attr ResourceGroupIdentity resource_group: (optional) Resource group for this resource. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + group](https://console.bluemix.net/apidocs/resource-manager#introduction) is + used. :attr int speed_mbps: Gateway speed in megabits per second. :attr str type: Gateway type. """ @@ -1774,8 +1770,8 @@ def __init__(self, ommitted and a CIDR will be selected automatically. :param ResourceGroupIdentity resource_group: (optional) Resource group for this resource. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is - used. + group](https://console.bluemix.net/apidocs/resource-manager#introduction) + is used. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( ", ".join(['GatewayTemplateGatewayTypeDedicatedTemplate', 'GatewayTemplateGatewayTypeConnectTemplate'])) @@ -2124,59 +2120,45 @@ class LocationOutput(): """ location. - :attr str billing_location: (optional) Billing location. Only present for - locations where provisioning is enabled. + :attr str billing_location: Billing location. :attr str building_colocation_owner: (optional) Building colocation owner. Only - present for offering_type=dedicated locations where provisioning is enabled. + present for offering_type=dedicated locations. :attr str display_name: Location long name. :attr str location_type: Location type. :attr str market: Location market. - :attr str market_geography: (optional) Location geography. Only present for - locations where provisioning is enabled. - :attr bool mzr: (optional) Is location a multi-zone region (MZR). Only present - for locations where provisioning is enabled. + :attr str market_geography: Location geography. + :attr bool mzr: Is location a multi-zone region (MZR). :attr str name: Location short name. :attr str offering_type: Location offering type. - :attr bool provision_enabled: Indicates for the specific offering_type whether - this location supports gateway provisioning. - :attr str vpc_region: (optional) Location's VPC region. Only present for - locations where provisioning is enabled. + :attr str vpc_region: (optional) Location's VPC region. """ def __init__(self, + billing_location: str, display_name: str, location_type: str, market: str, + market_geography: str, + mzr: bool, name: str, offering_type: str, - provision_enabled: bool, *, - billing_location: str = None, building_colocation_owner: str = None, - market_geography: str = None, - mzr: bool = None, vpc_region: str = None) -> None: """ Initialize a LocationOutput object. + :param str billing_location: Billing location. :param str display_name: Location long name. :param str location_type: Location type. :param str market: Location market. + :param str market_geography: Location geography. + :param bool mzr: Is location a multi-zone region (MZR). :param str name: Location short name. :param str offering_type: Location offering type. - :param bool provision_enabled: Indicates for the specific offering_type - whether this location supports gateway provisioning. - :param str billing_location: (optional) Billing location. Only present for - locations where provisioning is enabled. :param str building_colocation_owner: (optional) Building colocation owner. - Only present for offering_type=dedicated locations where provisioning is - enabled. - :param str market_geography: (optional) Location geography. Only present - for locations where provisioning is enabled. - :param bool mzr: (optional) Is location a multi-zone region (MZR). Only - present for locations where provisioning is enabled. - :param str vpc_region: (optional) Location's VPC region. Only present for - locations where provisioning is enabled. + Only present for offering_type=dedicated locations. + :param str vpc_region: (optional) Location's VPC region. """ self.billing_location = billing_location self.building_colocation_owner = building_colocation_owner @@ -2187,7 +2169,6 @@ def __init__(self, self.mzr = mzr self.name = name self.offering_type = offering_type - self.provision_enabled = provision_enabled self.vpc_region = vpc_region @classmethod @@ -2196,6 +2177,8 @@ def from_dict(cls, _dict: Dict) -> 'LocationOutput': args = {} if 'billing_location' in _dict: args['billing_location'] = _dict.get('billing_location') + else: + raise ValueError('Required property \'billing_location\' not present in LocationOutput JSON') if 'building_colocation_owner' in _dict: args['building_colocation_owner'] = _dict.get('building_colocation_owner') if 'display_name' in _dict: @@ -2212,8 +2195,12 @@ def from_dict(cls, _dict: Dict) -> 'LocationOutput': raise ValueError('Required property \'market\' not present in LocationOutput JSON') if 'market_geography' in _dict: args['market_geography'] = _dict.get('market_geography') + else: + raise ValueError('Required property \'market_geography\' not present in LocationOutput JSON') if 'mzr' in _dict: args['mzr'] = _dict.get('mzr') + else: + raise ValueError('Required property \'mzr\' not present in LocationOutput JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: @@ -2222,10 +2209,6 @@ def from_dict(cls, _dict: Dict) -> 'LocationOutput': args['offering_type'] = _dict.get('offering_type') else: raise ValueError('Required property \'offering_type\' not present in LocationOutput JSON') - if 'provision_enabled' in _dict: - args['provision_enabled'] = _dict.get('provision_enabled') - else: - raise ValueError('Required property \'provision_enabled\' not present in LocationOutput JSON') if 'vpc_region' in _dict: args['vpc_region'] = _dict.get('vpc_region') return cls(**args) @@ -2256,8 +2239,6 @@ def to_dict(self) -> Dict: _dict['name'] = self.name if hasattr(self, 'offering_type') and self.offering_type is not None: _dict['offering_type'] = self.offering_type - if hasattr(self, 'provision_enabled') and self.provision_enabled is not None: - _dict['provision_enabled'] = self.provision_enabled if hasattr(self, 'vpc_region') and self.vpc_region is not None: _dict['vpc_region'] = self.vpc_region return _dict @@ -2736,7 +2717,7 @@ def __ne__(self, other: 'PortsPaginatedCollectionNext') -> bool: class ResourceGroupIdentity(): """ Resource group for this resource. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. :attr str id: Resource group identifier. """ @@ -3068,7 +3049,8 @@ class GatewayTemplateGatewayTypeConnectTemplate(GatewayTemplate): :attr str name: The unique user-defined name for this gateway. :attr ResourceGroupIdentity resource_group: (optional) Resource group for this resource. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + group](https://console.bluemix.net/apidocs/resource-manager#introduction) is + used. :attr int speed_mbps: Gateway speed in megabits per second. :attr str type: Gateway type. :attr GatewayPortIdentity port: Select Port Label for new type=connect gateway. @@ -3110,8 +3092,8 @@ def __init__(self, ommitted and a CIDR will be selected automatically. :param ResourceGroupIdentity resource_group: (optional) Resource group for this resource. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is - used. + group](https://console.bluemix.net/apidocs/resource-manager#introduction) + is used. """ # pylint: disable=super-init-not-called self.bgp_asn = bgp_asn @@ -3248,7 +3230,8 @@ class GatewayTemplateGatewayTypeDedicatedTemplate(GatewayTemplate): :attr str name: The unique user-defined name for this gateway. :attr ResourceGroupIdentity resource_group: (optional) Resource group for this resource. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + group](https://console.bluemix.net/apidocs/resource-manager#introduction) is + used. :attr int speed_mbps: Gateway speed in megabits per second. :attr str type: Gateway type. :attr str carrier_name: Carrier name. @@ -3302,8 +3285,8 @@ def __init__(self, ommitted and a CIDR will be selected automatically. :param ResourceGroupIdentity resource_group: (optional) Resource group for this resource. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is - used. + group](https://console.bluemix.net/apidocs/resource-manager#introduction) + is used. :param str dedicated_hosting_id: (optional) The unique identifier of the dedicated hosting instance for this gateway. Valid only for Dedicated Hosting Offering. diff --git a/test/unit/test_direct_link_apis_v1.py b/test/unit/test_direct_link_apis_v1.py index 56b25c7..eabfc4c 100644 --- a/test/unit/test_direct_link_apis_v1.py +++ b/test/unit/test_direct_link_apis_v1.py @@ -557,7 +557,7 @@ def preprocess_url(self, request_url: str): def test_list_gateway_completion_notice_all_params(self): # Set up mock url = self.preprocess_url(base_url + '/gateways/testString/completion_notice') - mock_response = '"unknown property type: operation_response"' + mock_response = 'Contents of response byte-stream...' responses.add(responses.GET, url, body=mock_response, @@ -585,7 +585,7 @@ def test_list_gateway_completion_notice_all_params(self): def test_list_gateway_completion_notice_value_error(self): # Set up mock url = self.preprocess_url(base_url + '/gateways/testString/completion_notice') - mock_response = '"unknown property type: operation_response"' + mock_response = 'Contents of response byte-stream...' responses.add(responses.GET, url, body=mock_response, @@ -716,7 +716,7 @@ def preprocess_url(self, request_url: str): def test_list_gateway_letter_of_authorization_all_params(self): # Set up mock url = self.preprocess_url(base_url + '/gateways/testString/letter_of_authorization') - mock_response = '"unknown property type: operation_response"' + mock_response = 'Contents of response byte-stream...' responses.add(responses.GET, url, body=mock_response, @@ -744,7 +744,7 @@ def test_list_gateway_letter_of_authorization_all_params(self): def test_list_gateway_letter_of_authorization_value_error(self): # Set up mock url = self.preprocess_url(base_url + '/gateways/testString/letter_of_authorization') - mock_response = '"unknown property type: operation_response"' + mock_response = 'Contents of response byte-stream...' responses.add(responses.GET, url, body=mock_response, @@ -794,7 +794,7 @@ def preprocess_url(self, request_url: str): def test_list_offering_type_locations_all_params(self): # Set up mock url = self.preprocess_url(base_url + '/offering_types/dedicated/locations') - mock_response = '{"locations": [{"billing_location": "us", "building_colocation_owner": "MyProvider", "display_name": "Dallas 9", "location_type": "PoP", "market": "Dallas", "market_geography": "N/S America", "mzr": true, "name": "dal03", "offering_type": "dedicated", "provision_enabled": true, "vpc_region": "us-south"}]}' + mock_response = '{"locations": [{"billing_location": "us", "building_colocation_owner": "MyProvider", "display_name": "Dallas 9", "location_type": "PoP", "market": "Dallas", "market_geography": "N/S America", "mzr": true, "name": "dal03", "offering_type": "dedicated", "vpc_region": "us-south"}]}' responses.add(responses.GET, url, body=mock_response, @@ -822,7 +822,7 @@ def test_list_offering_type_locations_all_params(self): def test_list_offering_type_locations_value_error(self): # Set up mock url = self.preprocess_url(base_url + '/offering_types/dedicated/locations') - mock_response = '{"locations": [{"billing_location": "us", "building_colocation_owner": "MyProvider", "display_name": "Dallas 9", "location_type": "PoP", "market": "Dallas", "market_geography": "N/S America", "mzr": true, "name": "dal03", "offering_type": "dedicated", "provision_enabled": true, "vpc_region": "us-south"}]}' + mock_response = '{"locations": [{"billing_location": "us", "building_colocation_owner": "MyProvider", "display_name": "Dallas 9", "location_type": "PoP", "market": "Dallas", "market_geography": "N/S America", "mzr": true, "name": "dal03", "offering_type": "dedicated", "vpc_region": "us-south"}]}' responses.add(responses.GET, url, body=mock_response, @@ -862,7 +862,7 @@ def preprocess_url(self, request_url: str): def test_list_offering_type_location_cross_connect_routers_all_params(self): # Set up mock url = self.preprocess_url(base_url + '/offering_types/dedicated/locations/testString/cross_connect_routers') - mock_response = '{"cross_connect_routers": [{"router_name": "xcr01.dal03", "total_connections": 1}]}' + mock_response = '{"cross_connect_routers": [{"name": "xcr01.dal03", "total_connections": 1}]}' responses.add(responses.GET, url, body=mock_response, @@ -892,7 +892,7 @@ def test_list_offering_type_location_cross_connect_routers_all_params(self): def test_list_offering_type_location_cross_connect_routers_value_error(self): # Set up mock url = self.preprocess_url(base_url + '/offering_types/dedicated/locations/testString/cross_connect_routers') - mock_response = '{"cross_connect_routers": [{"router_name": "xcr01.dal03", "total_connections": 1}]}' + mock_response = '{"cross_connect_routers": [{"name": "xcr01.dal03", "total_connections": 1}]}' responses.add(responses.GET, url, body=mock_response, @@ -1021,7 +1021,7 @@ def test_list_ports_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 38 location_name = 'testString' # Invoke method @@ -1562,7 +1562,7 @@ def test_cross_connect_router_serialization(self): # Construct a json representation of a CrossConnectRouter model cross_connect_router_model_json = {} - cross_connect_router_model_json['router_name'] = 'xcr01.dal03' + cross_connect_router_model_json['name'] = 'xcr01.dal03' cross_connect_router_model_json['total_connections'] = 1 # Construct a model instance of CrossConnectRouter by calling from_dict on the json representation @@ -1868,7 +1868,6 @@ def test_location_collection_serialization(self): location_output_model['mzr'] = True location_output_model['name'] = 'dal03' location_output_model['offering_type'] = 'dedicated' - location_output_model['provision_enabled'] = True location_output_model['vpc_region'] = 'us-south' # Construct a json representation of a LocationCollection model @@ -1903,7 +1902,7 @@ def test_location_cross_connect_router_collection_serialization(self): # Construct dict forms of any model objects needed in order to build this model. cross_connect_router_model = {} # CrossConnectRouter - cross_connect_router_model['router_name'] = 'xcr01.dal03' + cross_connect_router_model['name'] = 'xcr01.dal03' cross_connect_router_model['total_connections'] = 1 # Construct a json representation of a LocationCrossConnectRouterCollection model @@ -1946,7 +1945,6 @@ def test_location_output_serialization(self): location_output_model_json['mzr'] = True location_output_model_json['name'] = 'dal03' location_output_model_json['offering_type'] = 'dedicated' - location_output_model_json['provision_enabled'] = True location_output_model_json['vpc_region'] = 'us-south' # Construct a model instance of LocationOutput by calling from_dict on the json representation