SaltStack Core¶
SaltStack Core
/api/saltstack/¶
A filter backend that uses django-filter. Supported actions and methods:
/api/saltstack/
Methods: GET
, POST
Supported fields for creation:
- name –
string
- project –
link to /api/projects/<uuid>/
- customer –
link to /api/customers/<uuid>/
- settings –
link to /api/service-settings/<uuid>/
- backend_url –
URL
(URL for SaltStack master API (required, e.g.: http://salt-master.example.com:8080)) - username –
string
(PAM user account with access to SaltStack API) - password –
string
- available_for_all –
boolean
(Service will be automatically added to all customers projects if it is available for all) - scope –
link to any: /api/sharepoint-tenants/<uuid>/, /api/exchange-tenants/<uuid>/
(VM that contains service) - exchange_target –
string
(Salt minion target with MS Exchange Domains) - sharepoint_management_ip –
string
(IP of the Sharepoint server. Used for setting up host resolution.) - sms_email_rcpt –
string
(Recipient e-mail template for SMS notifications (e.g. “{phone}@example.com”)) - sms_email_from –
string
(Sender e-mail address for SMS notifications) - ecp_url –
string
(Exchange Control Panel) - owa_url –
string
(URL for Outlook Web Access) - sharepoint_target –
string
(Salt minion target with MS Sharepoint Sites) - phone_regex –
string
(Phone number validation regex)
Filter fields:
- ?customer =
UUIDFilter
- ?name =
string
- ?settings =
link
- ?project_uuid =
UUIDFilter
- ?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/saltstack/<uuid>/
Methods: GET
, PUT
, PATCH
, DELETE
Supported fields for update:
- name –
string
- available_for_all –
boolean
(Service will be automatically added to all customers projects if it is available for all)
/api/saltstack/<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/saltstack/<uuid>/managed_resources/
Methods: GET
/api/saltstack/<uuid>/unlink/
Methods: POST
Unlink all related resources, service project link and service itself.
/api/saltstack-service-project-link/¶
A filter backend that uses django-filter. Supported actions and methods:
/api/saltstack-service-project-link/
Methods: GET
, POST
Supported fields for creation:
- project –
link to /api/projects/<uuid>/
- service –
link to /api/saltstack/<uuid>/
Filter fields:
- ?project =
link
- ?service_uuid =
UUIDFilter
- ?customer_uuid =
UUIDFilter
- ?project_uuid =
UUIDFilter
To get a list of connections between a project and an service, run GET against service_project_link_url as authenticated user. Note that a user can only see connections of a project where a user has a role.
If service has available_for_all flag, project-service connections are created automatically. Otherwise, in order to be able to provision resources, service must first be linked to a project. To do that, POST a connection between project and a service to service_project_link_url as stuff user or customer owner.
/api/saltstack-service-project-link/<pk>/
Methods: GET
, DELETE
To remove a link, issue DELETE to URL of the corresponding connection as stuff user or customer owner.