NodeConductor Azure

NodeConductor Azure

/api/azure/

A filter backend that uses django-filter. Supported actions and methods:

/api/azure/

Methods: GET, POST

Supported fields for creation:

  • namestring
  • project – link to /api/projects/<uuid>/
  • customerlink to /api/customers/<uuid>/
  • settingslink to /api/service-settings/<uuid>/
  • usernamestring (In the format of GUID)
  • certificatefile (X509 certificate in .PEM format)
  • available_for_all – boolean (Service will be automatically added to all customers projects if it is available for all)
  • scope – link to any: /api/azure-virtualmachines/<uuid>/ (VM that contains service)
  • cloud_service_name – string (If defined all connected SPLs will operate in the defined cloud service group)
  • location – choice('Central US', 'East Asia', 'East US 2', 'Japan West', 'North Europe', 'South Central US', 'Southeast Asia') (Azure region where to provision resources (default: “Central US”))
  • images_regex – string (Regular expression to limit images list)

Filter fields:

  • ?customer = string
  • ?name = string
  • ?settings = link
  • ?project_uuid = string
  • ?project = link
  • ?tag = ModelMultipleChoiceField
  • ?rtag = ModelMultipleChoiceField
  • ?shared = boolean
  • ?type = ServiceTypeFilter

To list all services without regard to its type, run GET against /api/services/ as an authenticated user.

To list services of specific type issue GET to specific endpoint from a list above as a customer owner. Individual endpoint used for every service type.

To create a service, issue a POST to specific endpoint from a list above as a customer owner. Individual endpoint used for every service type.

You can create service based on shared service settings. Example:

POST /api/digitalocean/ HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4
Host: example.com

{
    "name": "Common DigitalOcean",
    "customer": "http://example.com/api/customers/1040561ca9e046d2b74268600c7e1105/",
    "settings": "http://example.com/api/service-settings/93ba615d6111466ebe3f792669059cb4/"
}

Or provide your own credentials. Example:

POST /api/oracle/ HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4
Host: example.com

{
    "name": "My Oracle",
    "customer": "http://example.com/api/customers/1040561ca9e046d2b74268600c7e1105/",
    "backend_url": "https://oracle.example.com:7802/em",
    "username": "admin",
    "password": "secret"
}

/api/azure/<uuid>/

Methods: GET, PUT, PATCH, DELETE

Supported fields for update:

  • namestring
  • available_for_all – boolean (Service will be automatically added to all customers projects if it is available for all)

/api/azure/<uuid>/link/

Methods: GET, POST

To get a list of resources available for import, run GET against /<service_endpoint>/link/ as an authenticated user. Optionally project_uuid parameter can be supplied for services requiring it like OpenStack.

To import (link with NodeConductor) resource issue POST against the same endpoint with resource id.

POST /api/openstack/08039f01c9794efc912f1689f4530cf0/link/ HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4
Host: example.com

{
    "backend_id": "bd5ec24d-9164-440b-a9f2-1b3c807c5df3",
    "project": "http://example.com/api/projects/e5f973af2eb14d2d8c38d62bcbaccb33/"
}

/api/azure/<uuid>/managed_resources/

Methods: GET

/api/azure-virtualmachines/

SLA filter

Allows to filter or sort resources by actual_sla Default period is current year and month.

Example query parameters for filtering list of OpenStack instances:

/api/openstack-instances/?actual_sla=90&period=2016-02

Example query parameters for sorting list of OpenStack instances:

/api/openstack-instances/?o=actual_sla&period=2016-02

Monitoring filter

Filter and order resources by monitoring item. For example, given query dictionary

{
    'monitoring__installation_state': True
}

it produces following query

{
    'monitoring_item__name': 'installation_state',
    'monitoring_item__value': True
}

Example query parameters for sorting list of OpenStack instances:

/api/openstack-instances/?o=monitoring__installation_state

Tags ordering. Filtering for complex tags.

Example:
?tag__license-os=centos7 - will filter objects with tag “license-os:centos7”.
Allow to define next parameters in view:
  • tags_filter_db_field - name of tags field in database. Default: tags.
  • tags_filter_request_field - name of tags in request. Default: tag.

In PostgreSQL NULL values come last with ascending sort order. In MySQL NULL values come first with ascending sort order. This filter provides unified sorting for both databases. Supported actions and methods:

/api/azure-virtualmachines/

Methods: GET, POST

Supported fields for creation:

  • namestring
  • description – string
  • service_project_linklink to /api/azure-service-project-link/<pk>/
  • imagelink to /api/azure-images/<uuid>/
  • sizelink to /api/azure-sizes/<uuid>/
  • usernamestring
  • passwordstring
  • user_data – string (Additional data that will be added to instance on provisioning)

Filter fields:

  • ?customer = string
  • ?customer_native_name = string
  • ?project_name = string
  • ?service_settings_name = string
  • ?project_group = string
  • ?project_uuid = string
  • ?service_uuid = string
  • ?service_settings_uuid = string
  • ?customer_uuid = string
  • ?uuid = string
  • ?customer_abbreviation = string
  • ?name = string
  • ?project = string
  • ?state = choice('Deleting', 'Deletion Scheduled', 'Erred', 'Offline', 'Online', 'Provisioning', 'Provisioning Scheduled', 'Resizing', 'Resizing Scheduled', 'Restarting', 'Restarting Scheduled', 'Starting', 'Starting Scheduled', 'Stopping', 'Stopping Scheduled')
  • ?tag = ModelMultipleChoiceField
  • ?project_group_uuid = string
  • ?rtag = ModelMultipleChoiceField
  • ?service_name = string
  • ?project_group_name = string
  • ?description = string
  • ?customer_name = string

Order fields: created, customer_abbreviation, customer_name, customer_native_name, name, project_group_name, project_name, state

/api/azure-virtualmachines/<uuid>/

Methods: GET, PUT, PATCH, DELETE

Supported fields for update:

  • namestring
  • description – string

Optional field query parameter (can be list) allows to limit what fields are returned. For example, given request /api/openstack-instances/<uuid>/?field=uuid&field=name you get response like this:

{
    "uuid": "90bcfe38b0124c9bbdadd617b5d739f5",
    "name": "Azure Virtual Machine"
}

/api/azure-virtualmachines/<uuid>/rdp/

Methods: GET

/api/azure-virtualmachines/<uuid>/restart/

Methods: POST

Schedule resource restart. Resource must be in ONLINE state.

/api/azure-virtualmachines/<uuid>/start/

Methods: POST

Schedule resource start. Resource must be in OFFLINE state.

/api/azure-virtualmachines/<uuid>/stop/

Methods: POST

Schedule resource stop. Resource must be in ONLINE state.

/api/azure-virtualmachines/<uuid>/unlink/

Methods: POST

/api/azure-sizes/

A filter backend that uses django-filter. Supported actions and methods:

/api/azure-sizes/

Methods: GET

/api/azure-sizes/<uuid>/

Methods: GET

/api/azure-images/

A filter backend that uses django-filter. Supported actions and methods:

/api/azure-images/

Methods: GET

Filter fields:

  • ?name = string

/api/azure-images/<uuid>/

Methods: GET