onapsdk.aai.business package¶
Submodules¶
onapsdk.aai.business.customer module¶
AAI business module.
-
class
onapsdk.aai.business.customer.
Customer
(global_customer_id, subscriber_name, subscriber_type, resource_version=None)¶ Bases:
onapsdk.aai.aai_element.AaiResource
Customer class.
-
classmethod
create
(global_customer_id, subscriber_name, subscriber_type, service_subscriptions=None)¶ Create customer.
- Parameters
global_customer_id (str) – Global customer id used across ONAP to uniquely identify customer.
subscriber_name (str) – Subscriber name, an alternate way to retrieve a customer.
subscriber_type (str) – Subscriber type, a way to provide VID with only the INFRA customers.
service_subscriptions (Optional[Iterable[str]], optional) – Iterable of service subscription names should be created for newly created customer. Defaults to None.
- Returns
Customer object.
- Return type
-
classmethod
get_all
(global_customer_id=None, subscriber_name=None, subscriber_type=None)¶ Get all customers.
- Call an API to retrieve all customers. It can be filtered
by global-customer-id, subscriber-name and/or subsriber-type.
-
classmethod
get_all_url
()¶ Return an url to get all customers.
- Returns
URL to get all customers
- Return type
-
classmethod
get_by_global_customer_id
(global_customer_id)¶ Get customer by it’s global customer id.
-
get_service_subscription_by_service_type
(service_type)¶ Get subscribed service by service type.
Call a request to get service subscriptions filtered by service-type parameter.
- Parameters
service_type (str) – Service type
- Returns
Service subscription
- Return type
-
property
service_subscriptions
¶ Service subscriptions of customer resource.
- Yields
ServiceSubscription – ServiceSubscription object
- Return type
-
classmethod
-
class
onapsdk.aai.business.customer.
ServiceSubscription
(customer, service_type, resource_version)¶ Bases:
onapsdk.aai.aai_element.AaiResource
Service subscription class.
-
property
cloud_region
¶ Cloud region associated with service subscription.
IT’S DEPRECATED! cloud_regions parameter SHOULD BE USED
- Raises
ParameterError – Service subscription has no associated cloud region.
- Returns
CloudRegion object
- Return type
-
property
cloud_regions
¶ Cloud regions associated with service subscription.
- Yields
CloudRegion – CloudRegion object
- Return type
-
classmethod
create_from_api_response
(api_response, customer)¶ Create service subscription using API response dict.
- Returns
ServiceSubscription object.
- Return type
-
customer
: onapsdk.aai.business.customer.Customer¶
-
classmethod
get_all_url
(customer)¶ Return url to get all customers.
- Returns
Url to get all customers
- Return type
-
get_service_instance_by_id
(service_instance_id)¶ Get service instance using it’s ID.
- Parameters
service_instance_id (str) – ID of the service instance
- Returns
ServiceInstance object
- Return type
-
get_service_instance_by_name
(service_instance_name)¶ Get service instance using it’s name.
- Parameters
service_instance_name (str) – Name of the service instance
- Returns
ServiceInstance object
- Return type
-
link_to_cloud_region_and_tenant
(cloud_region, tenant)¶ Create relationship between object and cloud region with tenant.
- Parameters
cloud_region (CloudRegion) – Cloud region to link to
tenant (Tenant) – Cloud region tenant to link to
- Return type
-
property
service_instances
¶ Service instances.
- Yields
Iterator[ServiceInstance] – Service instance
- Return type
-
property
tenant
¶ Tenant associated with service subscription.
IT’S DEPRECATED! tenants parameter SHOULD BE USED
- Raises
ParameterError – Service subscription has no associated tenants
- Returns
Tenant object
- Return type
-
property
tenant_relationships
¶ Tenant related relationships.
Iterate through relationships and get related to tenant.
- Yields
Relationship – Relationship related to tenant.
- Return type
-
property
tenants
¶ Tenants associated with service subscription.
- Yields
Tenant – Tenant object
- Return type
-
property
onapsdk.aai.business.instance module¶
Base instance module.
-
class
onapsdk.aai.business.instance.
Instance
(resource_version=None, model_invariant_id=None, model_version_id=None)¶ Bases:
onapsdk.aai.aai_element.AaiResource
,abc.ABC
Abstract instance class.
-
abstract
delete
(a_la_carte=True)¶ Create instance deletion request.
Send request to delete instance
- Parameters
a_la_carte (boolean) – deletion mode
- Returns
Deletion request
- Return type
-
abstract
onapsdk.aai.business.line_of_business module¶
A&AI line of business module.
-
class
onapsdk.aai.business.line_of_business.
LineOfBusiness
(name, resource_version)¶ Bases:
onapsdk.aai.aai_element.AaiResource
Line of business class.
-
classmethod
create
(name)¶ Create line of business A&AI resource.
- Parameters
name (str) – line of business name
- Returns
Created LineOfBusiness object
- Return type
-
classmethod
get_all
()¶ Get all line of business.
- Yields
LineOfBusiness – LineOfBusiness object
- Return type
-
classmethod
get_all_url
()¶ Return url to get all lines of business.
- Returns
Url to get all lines of business
- Return type
-
classmethod
get_by_name
(name)¶ Get line of business resource by it’s name.
- Raises
ResourceNotFound – Line of business requested by a name does not exist.
- Returns
Line of business requested by a name.
- Return type
-
classmethod
onapsdk.aai.business.network module¶
Network instance module.
-
class
onapsdk.aai.business.network.
NetworkInstance
(service_instance, network_id, is_bound_to_vpn, is_provider_network, is_shared_network, is_external_network, network_name=None, network_type=None, network_role=None, network_technology=None, neutron_network_id=None, service_id=None, network_role_instance=None, resource_version=None, orchestration_status=None, heat_stack_id=None, mso_catalog_key=None, model_invariant_id=None, contrail_network_fqdn=None, persona_model_version=None, model_version_id=None, model_customization_id=None, widget_model_id=None, physical_network_name=None, widget_model_version=None, selflink=None, operational_status=None, is_trunked=None)¶ Bases:
onapsdk.aai.business.instance.Instance
Network instance class.
-
classmethod
create_from_api_response
(api_response, service_instance)¶ Create network instance object using HTTP API response dictionary.
- Parameters
api_response (dict) – A&AI API response dictionary
service_instance (ServiceInstance) – Service instance with which network is related
- Returns
VnfInstance object
- Return type
-
delete
(a_la_carte=True)¶ Create network deletion request.
Send request to delete network instance
- Parameters
a_la_carte (boolean) – deletion mode
- Returns
Deletion request
- Return type
-
classmethod
get_all_url
()¶ Return url to get all networks.
- Returns
Url to get all networks
- Return type
-
classmethod
onapsdk.aai.business.owning_entity module¶
A&AI owning entity module.
-
class
onapsdk.aai.business.owning_entity.
OwningEntity
(name, owning_entity_id, resource_version)¶ Bases:
onapsdk.aai.aai_element.AaiResource
Owning entity class.
-
classmethod
create
(name, owning_entity_id=None)¶ Create owning entity A&AI resource.
- Parameters
- Returns
Created OwningEntity object
- Return type
-
classmethod
get_all
()¶ Get all owning entities.
- Yields
OwningEntity – OwningEntity object
- Return type
-
classmethod
get_all_url
()¶ Return url to get all owning entities.
- Returns
Url to get all owning entities
- Return type
-
classmethod
get_by_owning_entity_id
(owning_entity_id)¶ Get owning entity by it’s ID.
- Parameters
owning_entity_id (str) – owning entity object id
- Returns
OwningEntity object
- Return type
-
classmethod
get_by_owning_entity_name
(owning_entity_name)¶ Get owning entity resource by it’s name.
- Raises
ResourceNotFound – Owning entity requested by a name does not exist.
- Returns
Owning entity requested by a name.
- Return type
-
classmethod
onapsdk.aai.business.platform module¶
A&AI platform module.
-
class
onapsdk.aai.business.platform.
Platform
(name, resource_version)¶ Bases:
onapsdk.aai.aai_element.AaiResource
Platform class.
-
classmethod
create
(name)¶ Create platform A&AI resource.
-
classmethod
get_all
()¶ Get all platform.
-
classmethod
get_all_url
()¶ Return url to get all platforms.
- Returns
Url to get all platforms
- Return type
-
classmethod
get_by_name
(name)¶ Get platform resource by it’s name.
- Raises
ResourceNotFound – Platform requested by a name does not exist.
- Returns
Platform requested by a name.
- Return type
-
classmethod
onapsdk.aai.business.pnf module¶
Pnf instance module.
-
class
onapsdk.aai.business.pnf.
PnfInstance
(service_instance, pnf_name, in_maint, selflink=None, pnf_id=None, equip_type=None, equip_vendor=None, equip_model=None, management_option=None, orchestration_status=None, ipaddress_v4_oam=None, sw_version=None, frame_id=None, serial_number=None, ipaddress_v4_loopback_0=None, ipaddress_v6_loopback_0=None, ipaddress_v4_aim=None, ipaddress_v6_aim=None, ipaddress_v6_oam=None, inv_status=None, resource_version=None, prov_status=None, nf_role=None, admin_status=None, operational_status=None, model_customization_id=None, model_invariant_id=None, model_version_id=None, pnf_ipv4_address=None, pnf_ipv6_address=None)¶ Bases:
onapsdk.aai.business.instance.Instance
Pnf instance class.
-
classmethod
create_from_api_response
(api_response, service_instance)¶ Create pnf instance object using HTTP API response dictionary.
- Parameters
api_response (dict) – A&AI API response dictionary
service_instance (ServiceInstance) – Service instance with which network is related
- Returns
PnfInstance object
- Return type
-
delete
(a_la_carte=True)¶ Delete Pnf instance.
PNF deletion it’s just A&AI resource deletion. That’s difference between another instances. You don’t have to wait for that task finish, because it’s not async task.
- Return type
-
classmethod
get_all
()¶ Get all PNF instances.
- Yields
PnfInstance – Pnf instance
- Return type
-
classmethod
get_all_url
()¶ Return an url to get all pnfs.
- Returns
Url to get all pnfs
- Return type
-
property
pnf
¶ Pnf associated with that pnf instance.
- Raises
ResourceNotFound – Could not find PNF for that PNF instance
- Returns
Pnf object associated with Pnf instance
- Return type
-
classmethod
onapsdk.aai.business.project module¶
A&AI project module.
-
class
onapsdk.aai.business.project.
Project
(name, resource_version)¶ Bases:
onapsdk.aai.aai_element.AaiResource
Project class.
-
classmethod
create
(name)¶ Create project A&AI resource.
-
classmethod
get_all
()¶ Get all project.
-
classmethod
get_all_url
()¶ Return url to get all projects.
- Returns
Url to get all projects
- Return type
-
classmethod
get_by_name
(name)¶ Get project resource by it’s name.
- Raises
ResourceNotFound – Project requested by a name does not exist.
- Returns
Project requested by a name.
- Return type
-
classmethod
onapsdk.aai.business.service module¶
Service instance module.
-
class
onapsdk.aai.business.service.
ServiceInstance
(service_subscription, instance_id, instance_name=None, service_type=None, service_role=None, environment_context=None, workload_context=None, created_at=None, updated_at=None, resource_version=None, description=None, model_invariant_id=None, model_version_id=None, persona_model_version=None, widget_model_id=None, widget_model_version=None, bandwith_total=None, vhn_portal_url=None, service_instance_location_id=None, selflink=None, orchestration_status=None, input_parameters=None)¶ Bases:
onapsdk.aai.business.instance.Instance
Service instanve class.
-
add_network
(network, line_of_business, platform, cloud_region=None, tenant=None, network_instance_name=None, subnets=None)¶ Add network into service instance.
Instantiate vl.
- Parameters
network (Network) – Network from service configuration to instantiate
line_of_business (LineOfBusiness) – LineOfBusiness to use in instantiation request
platform (Platform) – Platform to use in instantiation request
cloud_region (CloudRegion, optional) – Cloud region to use in instantiation request. Defaults to None. THAT PROPERTY WILL BE REQUIRED IN ONE OF THE FUTURE RELEASE. REFACTOR YOUR CODE TO USE IT!.
tenant (Tenant, optional) – Tenant to use in instnatiation request. Defaults to None. THAT PROPERTY WILL BE REQUIRED IN ONE OF THE FUTURE RELEASE. REFACTOR YOUR CODE TO USE IT!.
network_instance_name (str, optional) – Network instantion name. If no value is provided it’s going to be “Python_ONAP_SDK_network_instance_{str(uuid4())}”. Defaults to None.
- Raises
StatusError – Service orchestration status is not “Active”
- Returns
NetworkInstantiation request object
- Return type
-
add_vnf
(vnf, line_of_business, platform, cloud_region=None, tenant=None, vnf_instance_name=None, vnf_parameters=None, so_vnf=None, a_la_carte=True)¶ Add vnf into service instance.
Instantiate VNF.
- Parameters
vnf (Vnf) – Vnf from service configuration to instantiate
line_of_business (LineOfBusiness) – LineOfBusiness to use in instantiation request
platform (Platform) – Platform to use in instantiation request
cloud_region (CloudRegion, optional) – Cloud region to use in instantiation request. Defaults to None. THAT PROPERTY WILL BE REQUIRED IN ONE OF THE FUTURE RELEASE. REFACTOR YOUR CODE TO USE IT!.
tenant (Tenant, optional) – Tenant to use in instnatiation request. Defaults to None. THAT PROPERTY WILL BE REQUIRED IN ONE OF THE FUTURE RELEASE. REFACTOR YOUR CODE TO USE IT!.
vnf_instance_name (str, optional) – VNF instantion name. If no value is provided it’s going to be “Python_ONAP_SDK_vnf_instance_{str(uuid4())}”. Defaults to None.
vnf_parameters (Iterable[InstantiationParameter], optional) – InstantiationParameter to be passed as “userParams”. Defaults to None.
so_vnf (SoServiceVnf) – (SoServiceVnf, optional): object with vnf instance parameters. Defaults to None.
a_la_carte (bool) – instantiation type for vnf. Defaults to True.
- Raises
StatusError – Service orchestration status is not “Active”.
- Returns
VnfInstantiation request object
- Return type
-
classmethod
create
(service_subscription, instance_id, instance_name=None, service_type=None, service_role=None, environment_context=None, workload_context=None, created_at=None, updated_at=None, resource_version=None, description=None, model_invariant_id=None, model_version_id=None, persona_model_version=None, widget_model_id=None, widget_model_version=None, bandwith_total=None, vhn_portal_url=None, service_instance_location_id=None, selflink=None, orchestration_status=None, input_parameters=None)¶ Service instance creation.
- Parameters
service_subscription (ServiceSubscription) – service subscription which is belongs to
instance_id (str) – Uniquely identifies this instance of a service
instance_name (str, optional) – This field will store a name assigned to the service-instance. Defaults to None.
service_type (str, optional) – String capturing type of service. Defaults to None.
service_role (str, optional) – String capturing the service role. Defaults to None.
environment_context (str, optional) – This field will store the environment context assigned to the service-instance. Defaults to None.
workload_context (str, optional) – This field will store the workload context assigned to the service-instance. Defaults to None.
created_at (str, optional) – Create time of Network Service. Defaults to None.
updated_at (str, optional) – Last update of Network Service. Defaults to None.
description (str, optional) – Short description for service-instance. Defaults to None.
model_invariant_id (str, optional) – The ASDC model id for this resource or service model. Defaults to None.
model_version_id (str, optional) – The ASDC model version for this resource or service model. Defaults to None.
persona_model_version (str, optional) – The ASDC model version for this resource or service model. Defaults to None.
widget_model_id (str, optional) – The ASDC data dictionary widget model. This maps directly to the A&AI widget. Defaults to None.
widget_model_version (str, optional) – The ASDC data dictionary version of the widget model. This maps directly to the A&AI version of the widget. Defaults to None.
bandwith_total (str, optional) – Indicates the total bandwidth to be used for this service. Defaults to None.
vhn_portal_url (str, optional) – URL customers will use to access the vHN Portal. Defaults to None.
service_instance_location_id (str, optional) – An identifier that customers assign to the location where this service is being used. Defaults to None.
resource_version (str, optional) – Used for optimistic concurrency. Must be empty on create, valid on update and delete. Defaults to None.
selflink (str, optional) – Path to the controller object. Defaults to None.
orchestration_status (str, optional) – Orchestration status of this service. Defaults to None.
input_parameters (str, optional) – String capturing request parameters from SO to pass to Closed Loop. Defaults to None.
-
delete
(a_la_carte=True)¶ Create service deletion request.
Send a request to delete service instance
- Parameters
a_la_carte (boolean) – deletion mode
- Returns
Deletion request object
- Return type
-
classmethod
get_all_url
(service_subscription)¶ Return an url to get all service instances for service subscription.
- Parameters
service_subscription (ServiceSubscription) – Service subscription object
- Returns
Url to get all service instances for service subscription
- Return type
-
property
network_instances
¶ Network instances associated with service instance.
Returns iterator of NetworkInstance representing network instantiated for that service
- Yields
NetworkInstance – NetworkInstance object
- Return type
-
property
pnfs
¶ Pnfs associated with service instance.
Returns iterator of PnfInstance representing pnfs instantiated for that service
- Yields
PnfInstance – PnfInstance object
- Return type
-
property
sdc_service
¶ Sdc service related with that instance.
Sdc service model which was used to create that instance.
- Raises
ResourceNotFound – Service model not found
- Return type
-
property
vnf_instances
¶ Vnf instances associated with service instance.
Returns iterator of VnfInstances representing VNF instantiated for that service
- Yields
VnfInstance – VnfInstance object
- Return type
-
onapsdk.aai.business.sp_partner module¶
A&AI sp-partner module.
-
class
onapsdk.aai.business.sp_partner.
SpPartner
(sp_partner_id, resource_version, url=None, callsource=None, operational_status=None, model_customization_id=None, model_invariant_id=None, model_version_id=None)¶ Bases:
onapsdk.aai.aai_element.AaiResource
Sp partner class.
-
classmethod
create
(sp_partner_id, url='', callsource='', operational_status='', model_customization_id='', model_invariant_id='', model_version_id='')¶ Create sp partner A&AI resource.
- Parameters
sp_partner_id (str) – sp partner unique ID
url (str, optional) – Store the URL of this sp-partner. Defaults to None
callsource (str, optional) – Store the callsource of this sp-partner. Defaults to None
operational_status (str, optional) – Store the operational-status of this sp-partner. Defaults to None
model_customization_id (str, optional) – Store the model-customization-id of this sp-partner. Defaults to None
model_invariant_id (str, optional) – The ASDC model id for this sp-partner model. Defaults to None
model_version_id (str, optional) – The ASDC model version for this sp-partner model. Defaults to None
- Returns
Created SpPartner object
- Return type
-
classmethod
get_all
()¶ Get all sp partners.
-
classmethod
get_all_url
()¶ Return url to get all sp partners.
- Returns
Url to get all sp partners
- Return type
-
classmethod
get_by_sp_partner_id
(sp_partner_id)¶ Get sp partner by it’s ID.
-
classmethod
onapsdk.aai.business.vf_module module¶
VF module instance.
-
class
onapsdk.aai.business.vf_module.
VfModuleInstance
(vnf_instance, vf_module_id, is_base_vf_module, automated_assignment, vf_module_name=None, heat_stack_id=None, resource_version=None, model_invariant_id=None, orchestration_status=None, persona_model_version=None, model_version_id=None, model_customization_id=None, widget_model_id=None, widget_model_version=None, contrail_service_instance_fqdn=None, module_index=None, selflink=None)¶ Bases:
onapsdk.aai.business.instance.Instance
Vf module instance class.
-
classmethod
create_from_api_response
(api_response, vnf_instance)¶ Create vf module instance object using HTTP API response dictionary.
- Parameters
api_response (dict) – HTTP API response content
vnf_instance (VnfInstance) – VnfInstance associated with VfModuleInstance
- Returns
VfModuleInstance object
- Return type
-
delete
(a_la_carte=True)¶ Create deletion request.
Send request to delete VF module instance
- Parameters
a_la_carte (boolean) – deletion mode
- Returns
Deletion request object
- Return type
-
classmethod
get_all_url
(vnf_instance)¶ Return url to get all vf modules for vnf instance.
- Parameters
vnf_instance (VnfInstance) – VNF instance object
- Returns
Url to get all vf modules for vnf instance
- Return type
-
classmethod
onapsdk.aai.business.vnf module¶
Vnf instance module.
-
class
onapsdk.aai.business.vnf.
VnfInstance
(service_instance, vnf_id, vnf_type, in_maint, is_closed_loop_disabled, vnf_name=None, service_id=None, regional_resource_zone=None, prov_status=None, operational_status=None, equipment_role=None, orchestration_status=None, vnf_package_name=None, vnf_discriptor_name=None, job_id=None, heat_stack_id=None, mso_catalog_key=None, management_option=None, ipv4_oam_address=None, ipv4_loopback0_address=None, nm_lan_v6_address=None, management_v6_address=None, vcpu=None, vcpu_units=None, vmemory=None, vmemory_units=None, vdisk=None, vdisk_units=None, nshd=None, nvm=None, nnet=None, resource_version=None, encrypted_access_flag=None, model_invariant_id=None, model_version_id=None, persona_model_version=None, model_customization_id=None, widget_model_id=None, widget_model_version=None, as_number=None, regional_resource_subzone=None, nf_type=None, nf_function=None, nf_role=None, nf_naming_code=None, selflink=None, ipv4_oam_gateway_address=None, ipv4_oam_gateway_address_prefix_length=None, vlan_id_outer=None, nm_profile_name=None)¶ Bases:
onapsdk.aai.business.instance.Instance
VNF Instance class.
-
add_vf_module
(vf_module, cloud_region=None, tenant=None, vf_module_instance_name=None, vnf_parameters=None, use_preload=True)¶ Instantiate vf module for that VNF instance.
- Parameters
vf_module (VfModule) – VfModule to instantiate
cloud_region (CloudRegion, optional) – Cloud region to use in instantiation request. Defaults to None. THAT PROPERTY WILL BE REQUIRED IN ONE OF THE FUTURE RELEASE. REFACTOR YOUR CODE TO USE IT!.
tenant (Tenant, optional) – Tenant to use in instnatiation request. Defaults to None. THAT PROPERTY WILL BE REQUIRED IN ONE OF THE FUTURE RELEASE. REFACTOR YOUR CODE TO USE IT!.
vf_module_instance_name (str, optional) – VfModule instance name. Defaults to None.
vnf_parameters (Iterable[InstantiationParameter], optional) – InstantiationParameter to use for preloading or to be passed as “userParams”. Defaults to None.
use_preload (bool, optional) – Based on this flag InstantiationParameters are passed in preload or as “userParam” in the request. Defaults to True
- Returns
VfModuleInstantiation request object
- Return type
-
classmethod
create_from_api_response
(api_response, service_instance)¶ Create vnf instance object using HTTP API response dictionary.
- Returns
VnfInstance object
- Return type
-
delete
(a_la_carte=True)¶ Create VNF deletion request.
Send request to delete VNF instance
- Parameters
a_la_carte (boolean) – deletion mode
- Returns
Deletion request
- Return type
-
healthcheck
()¶ Execute healthcheck operation for vnf instance.
- Returns
VnfInstantiation object.
- Return type
-
update
(vnf_parameters=None)¶ Update vnf instance.
- Parameters
vnf_parameters (Iterable["InstantiationParameter"], Optional) – list of instantiation
for update operation. (parameters) –
- Raises
StatusError – Skip post instantiation configuration flag for VF to True. It might cause problems with SO component.
- Returns
VnfInstantiation object.
- Return type
-
property
vf_modules
¶ Vf modules associated with vnf instance.
- Yields
VfModuleInstance – VfModuleInstance associated with VnfInstance
- Return type
-
property
vnf
¶ Vnf associated with that vnf instance.
- Raises
ResourceNotFound – Could not find VNF for that VNF instance
- Returns
Vnf object associated with vnf instance
- Return type
-
Module contents¶
A&AI business package.