onapsdk.aai.cloud_infrastructure package

Submodules

onapsdk.aai.cloud_infrastructure.cloud_region module

Cloud region module.

class onapsdk.aai.cloud_infrastructure.cloud_region.AvailabilityZone(name, hypervisor_type, operational_status=None, resource_version=None)

Bases: object

Availability zone.

A collection of compute hosts/pservers

hypervisor_type: str
name: str
operational_status: str = None
resource_version: str = None
class onapsdk.aai.cloud_infrastructure.cloud_region.CloudRegion(cloud_owner, cloud_region_id, orchestration_disabled, in_maint, *, cloud_type='', owner_defined_type='', cloud_region_version='', identity_url='', cloud_zone='', complex_name='', sriov_automation='', cloud_extra_info='', upgrade_cycle='', resource_version='')

Bases: onapsdk.aai.aai_element.AaiResource

Cloud region class.

Represents A&AI cloud region object.

add_availability_zone(availability_zone_name, availability_zone_hypervisor_type, availability_zone_operational_status=None)

Add avaiability zone to cloud region.

Parameters
  • availability_zone_name (str) – Name of the availability zone. Unique across a cloud region

  • availability_zone_hypervisor_type (str) – Type of hypervisor

  • availability_zone_operational_status (str, optional) – State that indicates whether the availability zone should be used. Defaults to None.

Return type

None

add_esr_system_info(esr_system_info_id, user_name, password, system_type, system_name=None, esr_type=None, vendor=None, version=None, service_url=None, protocol=None, ssl_cacert=None, ssl_insecure=None, ip_address=None, port=None, cloud_domain=None, default_tenant=None, passive=None, remote_path=None, system_status=None, openstack_region_id=None, resource_version=None)

Add external system info to cloud region.

Parameters
  • esr_system_info_id (str) – Unique ID of esr system info

  • user_name (str) – username used to access external system

  • password (str) – password used to access external system

  • system_type (str) – it could be vim/vnfm/thirdparty-sdnc/ ems-resource/ems-performance/ems-alarm

  • system_name (str, optional) – name of external system. Defaults to None.

  • esr_type (str, optional) – type of external system. Defaults to None.

  • vendor (str, optional) – vendor of external system. Defaults to None.

  • version (str, optional) – version of external system. Defaults to None.

  • service_url (str, optional) – url used to access external system. Defaults to None.

  • protocol (str, optional) – protocol of third party SDNC, for example netconf/snmp. Defaults to None.

  • ssl_cacert (str, optional) – ca file content if enabled ssl on auth-url. Defaults to None.

  • ssl_insecure (bool, optional) – Whether to verify VIM’s certificate. Defaults to True.

  • ip_address (str, optional) – service IP of ftp server. Defaults to None.

  • port (str, optional) – service port of ftp server. Defaults to None.

  • cloud_domain (str, optional) – domain info for authentication. Defaults to None.

  • default_tenant (str, optional) – default tenant of VIM. Defaults to None.

  • passive (bool, optional) – ftp passive mode or not. Defaults to False.

  • remote_path (str, optional) – resource or performance data file path. Defaults to None.

  • system_status (str, optional) – he status of external system. Defaults to None.

  • openstack_region_id (str, optional) – OpenStack region ID used by MultiCloud plugin to interact with an OpenStack instance. Defaults to None.

Return type

None

add_tenant(tenant_id, tenant_name, tenant_context=None)

Add tenant to cloud region.

Parameters
  • tenant_id (str) – Unique id relative to the cloud-region.

  • tenant_name (str) – Readable name of tenant

  • tenant_context (str, optional) – This field will store the tenant context.. Defaults to None.

Return type

None

property availability_zones

Cloud region availability zones.

Iterate over CloudRegion availability zones. Relationship list is given using A&AI API call.

Returns

CloudRegion availability zone

Return type

Iterator[AvailabilityZone]

property complex

Complex related with cloud region.

Returns

Complex object related with CloudRegion or None if

CloudRegion has no relationship with any Complex

Return type

Optional[Complex]

classmethod create(cloud_owner, cloud_region_id, orchestration_disabled, in_maint, *, cloud_type='', owner_defined_type='', cloud_region_version='', identity_url='', cloud_zone='', complex_name='', sriov_automation='', cloud_extra_info='', upgrade_cycle='')

Create CloudRegion object.

Create cloud region with given values.

Returns

Created cloud region.

Return type

CloudRegion

delete()

Delete cloud region.

Return type

None

property esr_system_infos

Cloud region collection of persistent block-level external system auth info.

Returns

Cloud region external system address information.

Return type

Iterator[EsrSystemInfo]

classmethod get_all(cloud_owner=None, cloud_region_id=None, cloud_type=None, owner_defined_type=None)

Get all A&AI cloud regions.

Cloud regions can be filtered by 4 parameters: cloud-owner, cloud-region-id, cloud-type and owner-defined-type.

Yields
CloudRegion – CloudRegion object. Can not yield anything

if cloud region with given filter parameters doesn’t exist

Return type

Iterator[CloudRegion]

classmethod get_all_url()

Return url to get all cloud regions.

Returns

Url to get all cloud regions

Return type

str

get_availability_zone_by_name(zone_name)

Get availability zone with provided Name.

Parameters

name (availability_zone) – The name of the availibilty zone

Returns

AvailabilityZone object

Return type

AvailabilityZone

classmethod get_by_id(cloud_owner, cloud_region_id)

Get CloudRegion object by cloud_owner and cloud-region-id field value.

This method calls A&AI cloud region API filtering them by cloud_owner and cloud-region-id field value.

Raises

ResourceNotFound – Cloud region with given id does not exist.

Returns

CloudRegion object with given cloud-region-id.

Return type

CloudRegion

get_tenant(tenant_id)

Get tenant with provided ID.

Parameters

tenant_id (str) – Tenant ID

Returns

Tenant object

Return type

Tenant

get_tenants_by_name(tenant_name)

Get tenants with given name.

Parameters

tenant_name (str) – Tenant name

Returns

Iterate through cloud region tenants with given name

Return type

Iterator[Tenant]

Link cloud region to comples.

It creates relationhip object and add it into cloud region.

Return type

None

register_to_multicloud(default_tenant=None)

Register cloud to multicloud using MSB API.

Parameters

default_tenant (str, optional) – Default tenant. Defaults to None.

Return type

None

property tenants

Tenants iterator.

Cloud region tenants iterator.

Returns

Iterate through cloud region tenants

Return type

Iterator[Tenant]

unregister_from_multicloud()

Unregister cloud from mutlicloud.

Return type

None

property url

Cloud region object url.

URL used to call CloudRegion A&AI API

Returns

CloudRegion object url

Return type

str

class onapsdk.aai.cloud_infrastructure.cloud_region.EsrSystemInfo(esr_system_info_id, user_name, password, system_type, resource_version, system_name=None, esr_type=None, vendor=None, version=None, service_url=None, protocol=None, ssl_cacert=None, ssl_insecure=None, ip_address=None, port=None, cloud_domain=None, default_tenant=None, passive=None, remote_path=None, system_status=None, openstack_region_id=None)

Bases: object

Persist common address information of external systems.

cloud_domain: str = None
default_tenant: str = None
esr_system_info_id: str
esr_type: str = None
ip_address: str = None
openstack_region_id: str = None
passive: Optional[bool] = None
password: str
port: str = None
protocol: str = None
remote_path: str = None
resource_version: str
service_url: str = None
ssl_cacert: str = None
ssl_insecure: Optional[bool] = None
system_name: str = None
system_status: str = None
system_type: str
user_name: str
vendor: str = None
version: str = None

onapsdk.aai.cloud_infrastructure.complex module

A&AI Complex module.

class onapsdk.aai.cloud_infrastructure.complex.Complex(physical_location_id, *, name='', data_center_code='', identity_url='', resource_version='', physical_location_type='', street1='', street2='', city='', state='', postal_code='', country='', region='', latitude='', longitude='', elevation='', lata='', timezone='', data_owner='', data_source='', data_source_version='')

Bases: onapsdk.aai.aai_element.AaiResource

Complex class.

Collection of physical locations that can house cloud-regions.

classmethod create(physical_location_id, *, name='', data_center_code='', identity_url='', resource_version='', physical_location_type='', street1='', street2='', city='', state='', postal_code='', country='', region='', latitude='', longitude='', elevation='', lata='', timezone='', data_owner='', data_source='', data_source_version='')

Create complex.

Create complex object by calling A&AI API. If API request doesn’t fail it returns Complex object.

Returns

Created complex object

Return type

Complex

classmethod create_from_api_response(api_response)

Create complex object using given A&AI API response JSON.

Parameters

api_response (Dict[str, Any]) – Complex A&AI API response

Returns

Complex object created from given response

Return type

Complex

delete()

Delete complex.

Return type

None

classmethod get_all(physical_location_id=None, data_center_code=None, complex_name=None, identity_url=None)

Get all complexes from A&AI.

Call A&AI API to get all complex objects.

Parameters
  • physical_location_id (str, optional) – Unique identifier for physical location, e.g., CLLI. Defaults to None.

  • data_center_code (str, optional) – Data center code which can be an alternate way to identify a complex. Defaults to None.

  • complex_name (str, optional) – Gamma complex name for LCP instance. Defaults to None.

  • identity_url (str, optional) – URL of the keystone identity service. Defaults to None.

Yields
Complex – Complex object. Can not yield anything if any complex with given filter

parameters doesn’t exist

Return type

Iterator[Complex]

classmethod get_all_url()

Return an url to get all complexes.

Returns

URL to get all complexes

Return type

str

classmethod get_by_physical_location_id(physical_location_id)

Get complex by physical location id.

Parameters

physical_location_id (str) – Physical location id of Complex

Returns

Complex object

Return type

Complex

Raises

ResourceNotFound – Complex with given physical location id not found

property url

Complex url.

Returns

Complex url

Return type

str

onapsdk.aai.cloud_infrastructure.tenant module

A&AI Tenant module.

class onapsdk.aai.cloud_infrastructure.tenant.Tenant(cloud_region, tenant_id, tenant_name, tenant_context=None, resource_version=None)

Bases: onapsdk.aai.aai_element.AaiResource

Tenant class.

delete()

Delete tenant.

Remove tenant from cloud region.

Return type

None

classmethod get_all_url(cloud_region)

Return an url to get all tenants for given cloud region.

Parameters

cloud_region (CloudRegion) – Cloud region object

Returns

Url to get all tenants

Return type

str

property url

Tenant url.

Returns

Url which can be used to update or delete tenant.

Return type

str

Module contents

A&AI cloud infrastructure package.