onapsdk.nbi package

Submodules

onapsdk.nbi.nbi module

NBI module.

class onapsdk.nbi.nbi.Nbi

Bases: onapsdk.onap_service.OnapService, abc.ABC

NBI base class.

api_version = '/nbi/api/v4'
base_url = 'https://nbi.api.simpledemo.onap.org:30274'
classmethod is_status_ok()

Check NBI service status.

Returns

True if NBI works fine, False otherwise

Return type

bool

class onapsdk.nbi.nbi.Service(name, service_id, service_specification_name, service_specification_id, customer_id, customer_role, href)

Bases: onapsdk.nbi.nbi.Nbi

NBI service.

property customer

Service order Customer object.

Returns

Customer object

Return type

Customer

classmethod get_all(customer_id='generic')

Get all services for selected customer.

Parameters

customer_id (str) – Global customer ID

Yields

Service – Service object

Return type

Iterator[Service]

property service_specification

Service specification.

Returns

Service specification object

Return type

ServiceSpecification

class onapsdk.nbi.nbi.ServiceOrder(unique_id, href, priority, description, category, external_id, service_instance_name, state=None, customer=None, customer_id=None, service_specification=None, service_specification_id=None)

Bases: onapsdk.nbi.nbi.Nbi, onapsdk.utils.mixins.WaitForFinishMixin

Service order class.

class StatusEnum(value)

Bases: enum.Enum

Status enum.

Store possible statuses for service order:
  • completed,

  • failed,

  • inProgress.

If instantiation has status which is not covered by these values

unknown value is used.

ACKNOWLEDGED = 'acknowledged'
COMPLETED = 'completed'
FAILED = 'failed'
IN_PROGRESS = 'inProgress'
REJECTED = 'rejected'
UNKNOWN = 'unknown'
WAIT_FOR_SLEEP_TIME = 10
property completed

Store an information if service order is completed or not.

Service orded is completed if it’s status is COMPLETED.

Returns

True if service orded is completed, False otherwise.

Return type

bool

classmethod create(customer, service_specification, name=None, external_id=None)

Create service order.

Returns

ServiceOrder object

Return type

ServiceOrder

property customer

Get customer object used in service order.

Returns

Customer object

Return type

Customer

property failed

Store an information if service order is failed or not.

Service orded is completed if it’s status is FAILED.

Returns

True if service orded is failed, False otherwise.

Return type

bool

property finished

Store an information if service order is finished or not.

Service orded is finished if it’s status is not ACKNOWLEDGED or IN_PROGRESS.

Returns

True if service orded is finished, False otherwise.

Return type

bool

classmethod get_all()

Get all service orders.

Returns

ServiceOrder object

Return type

Iterator[ServiceOrder]

property rejected

Store an information if service order is rejected or not.

Service orded is completed if it’s status is REJECTED.

Returns

True if service orded is rejected, False otherwise.

Return type

bool

property service_specification

Service order service specification used in order item.

Returns

Service specification

Return type

ServiceSpecification

property status

Service order instantiation status.

It’s populated by call Service order endpoint.

Returns

Service order status.

Return type

StatusEnum

class onapsdk.nbi.nbi.ServiceSpecification(unique_id, name, invariant_uuid, category, distribution_status, version, lifecycle_status)

Bases: onapsdk.nbi.nbi.Nbi

NBI service specification class.

classmethod get_all()

Get all service specifications.

Yields

ServiceSpecification – Service specification object

Return type

Iterator[ServiceSpecification]

classmethod get_by_id(service_specification_id)

Get service specification by ID.

Parameters

service_specification_id (str) – Service specification ID

Returns

Service specification object

Return type

ServiceSpecification

Module contents

NBI package.