Oracle ====== Oracle /api/oracle/ ------------ A filter backend that uses django-filter. Supported actions and methods: .. topic:: ``/api/oracle/`` Methods: ``GET``, ``POST`` Supported fields for creation: * **name** -- ``string`` * project -- ``link to /api/projects//`` * **customer** -- ``link to /api/customers//`` * **settings** -- ``link to /api/service-settings//`` * token -- ``string`` (JIRA project key (e.g. 'GM')) * available_for_all -- ``boolean`` (Service will be automatically added to all customers projects if it is available for all) * scope -- ``link to any: /api/oracle-deployments//, /api/openstack-instances//, /api/openstack-tenants//, /api/openstack-volumes//, /api/openstack-snapshots//, /api/openstack-dr-backups//, /api/openstacktenant-volumes//, /api/openstacktenant-snapshots//, /api/openstacktenant-instances//, /api/openstacktenant-backups//, /api/jira-projects//`` (VM that contains service) 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: .. code-block:: http 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: .. code-block:: http 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" } .. topic:: ``/api/oracle//`` 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) .. topic:: ``/api/oracle//link/`` Methods: ``GET``, ``POST`` To get a list of resources available for import, run **GET** against *//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. .. code-block:: http 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/" } .. topic:: ``/api/oracle//managed_resources/`` Methods: ``GET`` .. topic:: ``/api/oracle//unlink/`` Methods: ``POST`` Unlink all related resources, service project link and service itself. /api/oracle-service-project-link/ --------------------------------- A filter backend that uses django-filter. Supported actions and methods: .. topic:: ``/api/oracle-service-project-link/`` Methods: ``GET``, ``POST`` Supported fields for creation: * **project** -- ``link to /api/projects//`` * **service** -- ``link to /api/oracle//`` 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. .. topic:: ``/api/oracle-service-project-link//`` Methods: ``GET``, ``DELETE`` To remove a link, issue **DELETE** to URL of the corresponding connection as stuff user or customer owner. /api/oracle-flavors/ -------------------- A filter backend that uses django-filter. Supported actions and methods: .. topic:: ``/api/oracle-flavors/`` Methods: ``GET`` Filter fields: * ?name = ``string`` .. topic:: ``/api/oracle-flavors//`` Methods: ``GET`` /api/oracle-deployments/ ------------------------ 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: .. code-block:: http /api/openstack-instances/?actual_sla=90&period=2016-02 Example query parameters for sorting list of OpenStack instances: .. code-block:: http /api/openstack-instances/?o=actual_sla&period=2016-02 Monitoring filter ^^^^^^^^^^^^^^^^^ Filter and order resources by monitoring item. For example, given query dictionary .. code-block:: http { 'monitoring__installation_state': True } it produces following query .. code-block:: http { 'monitoring_item__name': 'installation_state', 'monitoring_item__value': True } Example query parameters for sorting list of OpenStack instances: .. code-block:: http /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: .. topic:: ``/api/oracle-deployments/`` Methods: ``GET``, ``POST`` Supported fields for creation: * **name** -- ``string`` * description -- ``string`` * **service_project_link** -- ``link to /api/oracle-service-project-link//`` * **tenant** -- ``link to /api/openstack-tenants//`` * **flavor** -- ``link to /api/oracle-flavors//`` * ssh_public_key -- ``link to /api/keys//`` * db_name -- ``string`` * **db_size** -- ``integer`` (Data storage size in GB) * db_arch_size -- ``integer`` (Archive storage size in GB) * **db_type** -- ``choice('No database', 'RAC', 'Single Instance', 'Single Instance/ASM')`` * db_version -- ``choice('11.2.0.4', '12.1.0.2')`` * db_template -- ``choice('Data Warehouse', 'General Purpose')`` * db_charset -- ``choice('AL32UTF8 - Unicode UTF-8 Universal Character Set', 'AR8ISO8859P6 - ISO 8859-6 Latin/Arabic', 'AR8MSWIN1256 - MS Windows Code Page 1256 8-Bit Latin/Arabic', 'Other - please specify in Addtional Data field.')`` * user_data -- ``string`` Filter fields: * ?customer_native_name = ``string`` * ?service_settings_name = ``string`` * ?service_name = ``string`` * ?customer_uuid = ``UUIDFilter`` * ?customer_abbreviation = ``string`` * ?tag = ``ModelMultipleChoiceField`` * ?customer_name = ``string`` * ?uuid = ``UUIDFilter`` * ?project_group = ``UUIDFilter`` * ?state = ``choice('Creating', 'Creation Scheduled', 'Deleting', 'Deletion Scheduled', 'Erred', 'OK', 'Update Scheduled', 'Updating')`` * ?rtag = ``ModelMultipleChoiceField`` * ?project_name = ``string`` * ?description = ``string`` * ?service_uuid = ``UUIDFilter`` * ?service_settings_uuid = ``UUIDFilter`` * ?db_name = ``string`` * ?customer = ``UUIDFilter`` * ?name = ``string`` * ?project_uuid = ``UUIDFilter`` * ?project = ``UUIDFilter`` * ?project_group_uuid = ``UUIDFilter`` * ?project_group_name = ``string`` Order fields: ``state`` Request for DB Instance deletion or confirm deletion success. A proper action will be taken depending on the current deployment state. .. topic:: ``/api/oracle-deployments//`` Methods: ``GET``, ``PUT``, ``PATCH``, ``DELETE`` Supported fields for update: * **name** -- ``string`` * description -- ``string`` Optional `field` query parameter (can be list) allows to limit what fields are returned. For example, given request /api/openstack-instances//?field=uuid&field=name you get response like this: .. code-block:: javascript { "uuid": "90bcfe38b0124c9bbdadd617b5d739f5", "name": "Azure Virtual Machine" } Request for DB Instance deletion or confirm deletion success. A proper action will be taken depending on the current deployment state. .. topic:: ``/api/oracle-deployments//provision/`` Methods: ``POST`` Complete provisioning. Example: .. code-block:: http POST /api/oracle-deployments/a04a26e46def4724a0841abcb81926ac/provision/ HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4 Host: example.com { "report": "ORACONF=TST12DB DBTYPE=single DBNAME='TST12DB'" } .. topic:: ``/api/oracle-deployments//resize/`` Methods: ``POST`` Request for DB Instance resize. Example: .. code-block:: http POST /api/oracle-deployments/a04a26e46def4724a0841abcb81926ac/resize/ HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4 Host: example.com { "flavor": "http://example.com/api/oracle-flavors/ef86802458684056b18576a91daf7690/" } To confirm resize completion, issue an empty POST request to the same endpoint. .. topic:: ``/api/oracle-deployments//restart/`` Methods: ``POST`` Request for DB Instance restarting or confirm restarting success. A proper action will be taken depending on the current deployment state. .. topic:: ``/api/oracle-deployments//start/`` Methods: ``POST`` Request for DB Instance starting or confirm starting success. A proper action will be taken depending on the current deployment state. .. topic:: ``/api/oracle-deployments//stop/`` Methods: ``POST`` Request for DB Instance stopping or confirm stopping success. A proper action will be taken depending on the current deployment state. .. topic:: ``/api/oracle-deployments//support/`` Methods: ``POST`` File custom support request. .. code-block:: http POST /api/oracle-deployments/a04a26e46def4724a0841abcb81926ac/support/ HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4 Host: example.com { "message": "Could you make that DB running faster? Thanks." } .. topic:: ``/api/oracle-deployments//unlink/`` Methods: ``POST`` .. topic:: ``/api/oracle-deployments//update_report/`` Methods: ``POST`` Update provisioning report. Example: .. code-block:: http POST /api/oracle-deployments/a04a26e46def4724a0841abcb81926ac/update_report/ HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4 Host: example.com { "report": "ORACONF=TST12DB DBTYPE=single DBNAME='PRD12DB'" }