# Platform9 Controller Resource

The API allows you to get, update openstack export and import settings.

### GET /platform9/restore-settings

Get settings for the specified policy using its GUID.

Request Parameters
name | type | description
--- | --- | ---
backup-guid | query | The unique identifier of the policy for which settings are being requested.
cluster-guid | query |
hvm-guid | query |
project-guid | query |

Response Body
media type | data type | description
--- | --- | ---
application/json | RestoreSettingsResponse (JSON) | Returns an RestoreSettingsResponse object containing the settings for the specified policy.

#### Example

##### Request

    GET /platform9/restore-settings
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    { }

### GET /platform9/export-settings/default

Retrieve the default export settings.

Response Body
media type | data type | description
--- | --- | ---
application/json | ExportSettingsResponse (JSON) | Returns an ExportSettingsResponse object containing the default export settings.

#### Example

##### Request

    GET /platform9/export-settings/default
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    { }

### GET /platform9/export-settings/snapshot-types

Fetches a list of available snapshot types.

Response Body
media type | data type | description
--- | --- | ---
application/json | array of SnapshotType (JSON) | Returns a list of SnapshotType objects representing the available types of snapshots.

#### Example

##### Request

    GET /platform9/export-settings/snapshot-types
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    "GENERIC_SNAPSHOT"

### GET /platform9/export-settings/{guid}

Get settings for the specified policy using its GUID.

Request Parameters
name | type | description
--- | --- | ---
guid | path | The unique identifier of the policy for which settings are being requested.

Response Body
media type | data type | description
--- | --- | ---
application/json | ExportSettingsResponse (JSON) | Returns an ExportSettingsResponse object containing the settings for the specified policy.

#### Example

##### Request

    GET /platform9/export-settings/{guid}
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    { }

### POST /platform9/export-settings/{guid}

Creates new export settings for a specific virtual machine policy identified by the GUID. This endpoint allows clients to define custom settings for backups related to a particular policy.

Request Parameters
name | type | description
--- | --- | ---
guid | path | The unique identifier of the virtual machine policy for which to create the export settings.

Request Body
media type | data type | description
--- | --- | ---
application/json | ExportSettingsRequest (JSON) | The export settings details to be created, encapsulated within an ExportSettingsRequest object.

Response Body
media type | data type | description
--- | --- | ---
application/json | ExportSettingsResponse (JSON) | ExportSettingsResponse object containing the newly created export settings details.

#### Example

##### Request

    POST /platform9/export-settings/{guid}
    Content-Type: application/json
    Accept: application/json

    {
      "snapshotType" : {
        "name" : "...",
        "description" : "..."
      },
      "sourceSettingType" : "..."
    }

##### Response

    HTTP/1.1 201 Created
    Content-Type: application/json

    { }

### PUT /platform9/export-settings/{guid}

Updates the existing export settings for a specific virtual machine policy identified by the GUID. This endpoint allows clients to modify existing settings to adjust to new requirements or correct previous configurations.

Request Parameters
name | type | description
--- | --- | ---
guid | path | The unique identifier of the virtual machine policy for which the export settings are to be updated.

Request Body
media type | data type | description
--- | --- | ---
application/json | ExportSettingsRequest (JSON) | The new export settings details, provided as an ExportSettingsRequest object, which will replace the existing settings.

Response Body
media type | data type | description
--- | --- | ---
application/json | ExportSettingsResponse (JSON) | ExportSettingsResponse object containing the updated export settings details.

#### Example

##### Request

    PUT /platform9/export-settings/{guid}
    Content-Type: application/json
    Accept: application/json

    {
      "snapshotType" : {
        "name" : "...",
        "description" : "..."
      },
      "sourceSettingType" : "..."
    }

##### Response

    HTTP/1.1 204 No Content
    Content-Type: application/json

    { }