# Manage & Operate › Cost Center › Export FOCUS API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Manage & Operate product's sections: https://developers.eu.ovhcloud.com/reference/manage-operate/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 5 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/manage-operate/cost-center/export-focus/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/manage-operate/cost-center/export-focus.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/manage-operate/cost-center/export-focus.json?format=openapi3

## Operations

- `GET /finops/bucketExport` — List FinOps bucket export configurations. The target bucket must be S3™*-compatible.
- `GET /finops/bucketExport/{id}` — Get a FinOps bucket export configuration. The target bucket must be S3™*-compatible.
- `POST /finops/bucketExport` — Create a FinOps bucket export configuration. The target bucket must be S3™*-compatible.
- `DELETE /finops/bucketExport/{id}` — Delete a FinOps bucket export configuration. The target bucket must be S3™*-compatible.
- `PUT /finops/bucketExport/{id}` — Modify a FinOps bucket export configuration. The target bucket must be S3™*-compatible.

## List FinOps bucket export configurations. The target bucket must be S3™*-compatible.

`GET /v2/finops/bucketExport`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/cost-center/export-focus/#get-finops-bucketexport

**Status:** Beta version  
**IAM actions:** `account:apiovh:finops/bucketExport/get`

<sup>*</sup> S3 is a trademark filed by Amazon Technologies,Inc. OVHcloud's service is not sponsored by, endorsed by, or otherwise affiliated with Amazon Technologies,Inc.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | finops.bucketExport.AsyncConfiguration[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string |  | Checksum of the Bucket Export Configuration |
| `currentState` | finops.bucketExport.Configuration | read-only | Current state of the billing account |
| `currentState.bucketConfiguration` | finops.bucketExport.BucketConfiguration |  | Configuration of the target bucket, which must be S3™*-compatible |
| `currentState.bucketConfiguration.accessKey` | string (password) | yes | S3™* access key |
| `currentState.bucketConfiguration.bucketName` | string | yes | Name of the bucket where the file will be put |
| `currentState.bucketConfiguration.endpointURL` | string | yes | Hostname used to reach the S3™* cluster |
| `currentState.bucketConfiguration.pathPrefix` | string |  | Folder where the files will be created |
| `currentState.bucketConfiguration.region` | string | yes | S3™* region name |
| `currentState.bucketConfiguration.secretKey` | string (password) | yes | S3™* secret key |
| `currentState.exportHour` | integer |  | The hour (in UTC) we will deposit the file at. For example, if set to 7, the export will be triggered starting at 7:00 UTC. Only applicable to period=DAILY. |
| `currentState.filePolicy` | finops.bucketExport.FilePolicyEnum |  | Strategy for file creation — one of `CREATE`, `REPLACE` |
| `currentState.period` | finops.bucketExport.PeriodEnum |  | The period at which your finops data will be exported. Defaults to DAILY. — one of `DAILY`, `HOURLY` |
| `currentState.scope` | string | read-only | Scope of this export |
| `currentTasks` | common.CurrentTask[] | read-only | Task to do on this billing account |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string | read-only | Unique identifier of the billing account |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Billing account readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | finops.bucketExport.Configuration |  | Target Spec for the FinOps Bucket Export Configuration |
| `targetSpec.bucketConfiguration` | finops.bucketExport.BucketConfiguration |  | Configuration of the target bucket, which must be S3™*-compatible |
| `targetSpec.bucketConfiguration.accessKey` | string (password) | yes | S3™* access key |
| `targetSpec.bucketConfiguration.bucketName` | string | yes | Name of the bucket where the file will be put |
| `targetSpec.bucketConfiguration.endpointURL` | string | yes | Hostname used to reach the S3™* cluster |
| `targetSpec.bucketConfiguration.pathPrefix` | string |  | Folder where the files will be created |
| `targetSpec.bucketConfiguration.region` | string | yes | S3™* region name |
| `targetSpec.bucketConfiguration.secretKey` | string (password) | yes | S3™* secret key |
| `targetSpec.exportHour` | integer |  | The hour (in UTC) we will deposit the file at. For example, if set to 7, the export will be triggered starting at 7:00 UTC. Only applicable to period=DAILY. |
| `targetSpec.filePolicy` | finops.bucketExport.FilePolicyEnum |  | Strategy for file creation — one of `CREATE`, `REPLACE` |
| `targetSpec.period` | finops.bucketExport.PeriodEnum |  | The period at which your finops data will be exported. Defaults to DAILY. — one of `DAILY`, `HOURLY` |
| `targetSpec.scope` | string | read-only | Scope of this export |

```json
[
  {
    "checksum": "string",
    "currentState": {
      "bucketConfiguration": {
        "accessKey": "string",
        "bucketName": "string",
        "endpointURL": "string",
        "pathPrefix": "string",
        "region": "string",
        "secretKey": "string"
      },
      "exportHour": 0,
      "filePolicy": "CREATE",
      "period": "DAILY",
      "scope": "string"
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "id": "string",
    "resourceStatus": "CREATING",
    "targetSpec": {
      "bucketConfiguration": {
        "accessKey": "string",
        "bucketName": "string",
        "endpointURL": "string",
        "pathPrefix": "string",
        "region": "string",
        "secretKey": "string"
      },
      "exportHour": 0,
      "filePolicy": "CREATE",
      "period": "DAILY",
      "scope": "string"
    }
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/finops/bucketExport" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/finops/bucketExport")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/finops/bucketExport");

print_r($result);
?>
```

## Get a FinOps bucket export configuration. The target bucket must be S3™*-compatible.

`GET /v2/finops/bucketExport/{id}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/cost-center/export-focus/#get-finops-bucketexport-id

**Status:** Beta version  
**IAM actions:** `account:apiovh:finops/bucketExport/get`

<sup>*</sup> S3 is a trademark filed by Amazon Technologies,Inc. OVHcloud's service is not sponsored by, endorsed by, or otherwise affiliated with Amazon Technologies,Inc.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Id |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | finops.bucketExport.AsyncConfiguration | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string |  | Checksum of the Bucket Export Configuration |
| `currentState` | finops.bucketExport.Configuration | read-only | Current state of the billing account |
| `currentState.bucketConfiguration` | finops.bucketExport.BucketConfiguration |  | Configuration of the target bucket, which must be S3™*-compatible |
| `currentState.bucketConfiguration.accessKey` | string (password) | yes | S3™* access key |
| `currentState.bucketConfiguration.bucketName` | string | yes | Name of the bucket where the file will be put |
| `currentState.bucketConfiguration.endpointURL` | string | yes | Hostname used to reach the S3™* cluster |
| `currentState.bucketConfiguration.pathPrefix` | string |  | Folder where the files will be created |
| `currentState.bucketConfiguration.region` | string | yes | S3™* region name |
| `currentState.bucketConfiguration.secretKey` | string (password) | yes | S3™* secret key |
| `currentState.exportHour` | integer |  | The hour (in UTC) we will deposit the file at. For example, if set to 7, the export will be triggered starting at 7:00 UTC. Only applicable to period=DAILY. |
| `currentState.filePolicy` | finops.bucketExport.FilePolicyEnum |  | Strategy for file creation — one of `CREATE`, `REPLACE` |
| `currentState.period` | finops.bucketExport.PeriodEnum |  | The period at which your finops data will be exported. Defaults to DAILY. — one of `DAILY`, `HOURLY` |
| `currentState.scope` | string | read-only | Scope of this export |
| `currentTasks` | common.CurrentTask[] | read-only | Task to do on this billing account |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string | read-only | Unique identifier of the billing account |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Billing account readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | finops.bucketExport.Configuration |  | Target Spec for the FinOps Bucket Export Configuration |
| `targetSpec.bucketConfiguration` | finops.bucketExport.BucketConfiguration |  | Configuration of the target bucket, which must be S3™*-compatible |
| `targetSpec.bucketConfiguration.accessKey` | string (password) | yes | S3™* access key |
| `targetSpec.bucketConfiguration.bucketName` | string | yes | Name of the bucket where the file will be put |
| `targetSpec.bucketConfiguration.endpointURL` | string | yes | Hostname used to reach the S3™* cluster |
| `targetSpec.bucketConfiguration.pathPrefix` | string |  | Folder where the files will be created |
| `targetSpec.bucketConfiguration.region` | string | yes | S3™* region name |
| `targetSpec.bucketConfiguration.secretKey` | string (password) | yes | S3™* secret key |
| `targetSpec.exportHour` | integer |  | The hour (in UTC) we will deposit the file at. For example, if set to 7, the export will be triggered starting at 7:00 UTC. Only applicable to period=DAILY. |
| `targetSpec.filePolicy` | finops.bucketExport.FilePolicyEnum |  | Strategy for file creation — one of `CREATE`, `REPLACE` |
| `targetSpec.period` | finops.bucketExport.PeriodEnum |  | The period at which your finops data will be exported. Defaults to DAILY. — one of `DAILY`, `HOURLY` |
| `targetSpec.scope` | string | read-only | Scope of this export |

```json
{
  "checksum": "string",
  "currentState": {
    "bucketConfiguration": {
      "accessKey": "string",
      "bucketName": "string",
      "endpointURL": "string",
      "pathPrefix": "string",
      "region": "string",
      "secretKey": "string"
    },
    "exportHour": 0,
    "filePolicy": "CREATE",
    "period": "DAILY",
    "scope": "string"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "string",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "bucketConfiguration": {
      "accessKey": "string",
      "bucketName": "string",
      "endpointURL": "string",
      "pathPrefix": "string",
      "region": "string",
      "secretKey": "string"
    },
    "exportHour": 0,
    "filePolicy": "CREATE",
    "period": "DAILY",
    "scope": "string"
  }
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/finops/bucketExport/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/finops/bucketExport/{id}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/finops/bucketExport/{id}");

print_r($result);
?>
```

## Create a FinOps bucket export configuration. The target bucket must be S3™*-compatible.

`POST /v2/finops/bucketExport`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/cost-center/export-focus/#post-finops-bucketexport

**Status:** Beta version  
**IAM actions:** `account:apiovh:finops/bucketExport/create`

<sup>*</sup> S3 is a trademark filed by Amazon Technologies,Inc. OVHcloud's service is not sponsored by, endorsed by, or otherwise affiliated with Amazon Technologies,Inc.

### Request body (required)

Type: `finops.bucketExport.AsyncCreateConfiguration`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | finops.bucketExport.Configuration | yes | Target Spec for the bucket export configuration |
| `targetSpec.bucketConfiguration` | finops.bucketExport.BucketConfiguration |  | Configuration of the target bucket, which must be S3™*-compatible |
| `targetSpec.bucketConfiguration.accessKey` | string (password) | yes | S3™* access key |
| `targetSpec.bucketConfiguration.bucketName` | string | yes | Name of the bucket where the file will be put |
| `targetSpec.bucketConfiguration.endpointURL` | string | yes | Hostname used to reach the S3™* cluster |
| `targetSpec.bucketConfiguration.pathPrefix` | string |  | Folder where the files will be created |
| `targetSpec.bucketConfiguration.region` | string | yes | S3™* region name |
| `targetSpec.bucketConfiguration.secretKey` | string (password) | yes | S3™* secret key |
| `targetSpec.exportHour` | integer |  | The hour (in UTC) we will deposit the file at. For example, if set to 7, the export will be triggered starting at 7:00 UTC. Only applicable to period=DAILY. |
| `targetSpec.filePolicy` | finops.bucketExport.FilePolicyEnum |  | Strategy for file creation — one of `CREATE`, `REPLACE` |
| `targetSpec.period` | finops.bucketExport.PeriodEnum |  | The period at which your finops data will be exported. Defaults to DAILY. — one of `DAILY`, `HOURLY` |
| `targetSpec.scope` | string | read-only | Scope of this export |

```json
{
  "targetSpec": {
    "bucketConfiguration": {
      "accessKey": "string",
      "bucketName": "string",
      "endpointURL": "string",
      "pathPrefix": "string",
      "region": "string",
      "secretKey": "string"
    },
    "exportHour": 0,
    "filePolicy": "CREATE",
    "period": "DAILY"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | finops.bucketExport.AsyncConfiguration | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string |  | Checksum of the Bucket Export Configuration |
| `currentState` | finops.bucketExport.Configuration | read-only | Current state of the billing account |
| `currentState.bucketConfiguration` | finops.bucketExport.BucketConfiguration |  | Configuration of the target bucket, which must be S3™*-compatible |
| `currentState.bucketConfiguration.accessKey` | string (password) | yes | S3™* access key |
| `currentState.bucketConfiguration.bucketName` | string | yes | Name of the bucket where the file will be put |
| `currentState.bucketConfiguration.endpointURL` | string | yes | Hostname used to reach the S3™* cluster |
| `currentState.bucketConfiguration.pathPrefix` | string |  | Folder where the files will be created |
| `currentState.bucketConfiguration.region` | string | yes | S3™* region name |
| `currentState.bucketConfiguration.secretKey` | string (password) | yes | S3™* secret key |
| `currentState.exportHour` | integer |  | The hour (in UTC) we will deposit the file at. For example, if set to 7, the export will be triggered starting at 7:00 UTC. Only applicable to period=DAILY. |
| `currentState.filePolicy` | finops.bucketExport.FilePolicyEnum |  | Strategy for file creation — one of `CREATE`, `REPLACE` |
| `currentState.period` | finops.bucketExport.PeriodEnum |  | The period at which your finops data will be exported. Defaults to DAILY. — one of `DAILY`, `HOURLY` |
| `currentState.scope` | string | read-only | Scope of this export |
| `currentTasks` | common.CurrentTask[] | read-only | Task to do on this billing account |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string | read-only | Unique identifier of the billing account |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Billing account readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | finops.bucketExport.Configuration |  | Target Spec for the FinOps Bucket Export Configuration |
| `targetSpec.bucketConfiguration` | finops.bucketExport.BucketConfiguration |  | Configuration of the target bucket, which must be S3™*-compatible |
| `targetSpec.bucketConfiguration.accessKey` | string (password) | yes | S3™* access key |
| `targetSpec.bucketConfiguration.bucketName` | string | yes | Name of the bucket where the file will be put |
| `targetSpec.bucketConfiguration.endpointURL` | string | yes | Hostname used to reach the S3™* cluster |
| `targetSpec.bucketConfiguration.pathPrefix` | string |  | Folder where the files will be created |
| `targetSpec.bucketConfiguration.region` | string | yes | S3™* region name |
| `targetSpec.bucketConfiguration.secretKey` | string (password) | yes | S3™* secret key |
| `targetSpec.exportHour` | integer |  | The hour (in UTC) we will deposit the file at. For example, if set to 7, the export will be triggered starting at 7:00 UTC. Only applicable to period=DAILY. |
| `targetSpec.filePolicy` | finops.bucketExport.FilePolicyEnum |  | Strategy for file creation — one of `CREATE`, `REPLACE` |
| `targetSpec.period` | finops.bucketExport.PeriodEnum |  | The period at which your finops data will be exported. Defaults to DAILY. — one of `DAILY`, `HOURLY` |
| `targetSpec.scope` | string | read-only | Scope of this export |

```json
{
  "checksum": "string",
  "currentState": {
    "bucketConfiguration": {
      "accessKey": "string",
      "bucketName": "string",
      "endpointURL": "string",
      "pathPrefix": "string",
      "region": "string",
      "secretKey": "string"
    },
    "exportHour": 0,
    "filePolicy": "CREATE",
    "period": "DAILY",
    "scope": "string"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "string",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "bucketConfiguration": {
      "accessKey": "string",
      "bucketName": "string",
      "endpointURL": "string",
      "pathPrefix": "string",
      "region": "string",
      "secretKey": "string"
    },
    "exportHour": 0,
    "filePolicy": "CREATE",
    "period": "DAILY",
    "scope": "string"
  }
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/finops/bucketExport" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: finops.bucketExport.AsyncCreateConfiguration
result = client.post("/v2/finops/bucketExport",
	targetSpec = None, # Target Spec for the bucket export configuration (type: finops.bucketExport.Configuration)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: finops.bucketExport.AsyncCreateConfiguration
$result = $ovh->post("/v2/finops/bucketExport", array(
	targetSpec => null, // Target Spec for the bucket export configuration (type: finops.bucketExport.Configuration)
));

print_r($result);
?>
```

## Delete a FinOps bucket export configuration. The target bucket must be S3™*-compatible.

`DELETE /v2/finops/bucketExport/{id}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/cost-center/export-focus/#delete-finops-bucketexport-id

**Status:** Beta version  
**IAM actions:** `account:apiovh:finops/bucketExport/delete`

<sup>*</sup> S3 is a trademark filed by Amazon Technologies,Inc. OVHcloud's service is not sponsored by, endorsed by, or otherwise affiliated with Amazon Technologies,Inc.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Id |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | finops.bucketExport.AsyncConfiguration | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string |  | Checksum of the Bucket Export Configuration |
| `currentState` | finops.bucketExport.Configuration | read-only | Current state of the billing account |
| `currentState.bucketConfiguration` | finops.bucketExport.BucketConfiguration |  | Configuration of the target bucket, which must be S3™*-compatible |
| `currentState.bucketConfiguration.accessKey` | string (password) | yes | S3™* access key |
| `currentState.bucketConfiguration.bucketName` | string | yes | Name of the bucket where the file will be put |
| `currentState.bucketConfiguration.endpointURL` | string | yes | Hostname used to reach the S3™* cluster |
| `currentState.bucketConfiguration.pathPrefix` | string |  | Folder where the files will be created |
| `currentState.bucketConfiguration.region` | string | yes | S3™* region name |
| `currentState.bucketConfiguration.secretKey` | string (password) | yes | S3™* secret key |
| `currentState.exportHour` | integer |  | The hour (in UTC) we will deposit the file at. For example, if set to 7, the export will be triggered starting at 7:00 UTC. Only applicable to period=DAILY. |
| `currentState.filePolicy` | finops.bucketExport.FilePolicyEnum |  | Strategy for file creation — one of `CREATE`, `REPLACE` |
| `currentState.period` | finops.bucketExport.PeriodEnum |  | The period at which your finops data will be exported. Defaults to DAILY. — one of `DAILY`, `HOURLY` |
| `currentState.scope` | string | read-only | Scope of this export |
| `currentTasks` | common.CurrentTask[] | read-only | Task to do on this billing account |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string | read-only | Unique identifier of the billing account |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Billing account readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | finops.bucketExport.Configuration |  | Target Spec for the FinOps Bucket Export Configuration |
| `targetSpec.bucketConfiguration` | finops.bucketExport.BucketConfiguration |  | Configuration of the target bucket, which must be S3™*-compatible |
| `targetSpec.bucketConfiguration.accessKey` | string (password) | yes | S3™* access key |
| `targetSpec.bucketConfiguration.bucketName` | string | yes | Name of the bucket where the file will be put |
| `targetSpec.bucketConfiguration.endpointURL` | string | yes | Hostname used to reach the S3™* cluster |
| `targetSpec.bucketConfiguration.pathPrefix` | string |  | Folder where the files will be created |
| `targetSpec.bucketConfiguration.region` | string | yes | S3™* region name |
| `targetSpec.bucketConfiguration.secretKey` | string (password) | yes | S3™* secret key |
| `targetSpec.exportHour` | integer |  | The hour (in UTC) we will deposit the file at. For example, if set to 7, the export will be triggered starting at 7:00 UTC. Only applicable to period=DAILY. |
| `targetSpec.filePolicy` | finops.bucketExport.FilePolicyEnum |  | Strategy for file creation — one of `CREATE`, `REPLACE` |
| `targetSpec.period` | finops.bucketExport.PeriodEnum |  | The period at which your finops data will be exported. Defaults to DAILY. — one of `DAILY`, `HOURLY` |
| `targetSpec.scope` | string | read-only | Scope of this export |

```json
{
  "checksum": "string",
  "currentState": {
    "bucketConfiguration": {
      "accessKey": "string",
      "bucketName": "string",
      "endpointURL": "string",
      "pathPrefix": "string",
      "region": "string",
      "secretKey": "string"
    },
    "exportHour": 0,
    "filePolicy": "CREATE",
    "period": "DAILY",
    "scope": "string"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "string",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "bucketConfiguration": {
      "accessKey": "string",
      "bucketName": "string",
      "endpointURL": "string",
      "pathPrefix": "string",
      "region": "string",
      "secretKey": "string"
    },
    "exportHour": 0,
    "filePolicy": "CREATE",
    "period": "DAILY",
    "scope": "string"
  }
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/finops/bucketExport/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/v2/finops/bucketExport/{id}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/v2/finops/bucketExport/{id}");

print_r($result);
?>
```

## Modify a FinOps bucket export configuration. The target bucket must be S3™*-compatible.

`PUT /v2/finops/bucketExport/{id}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/cost-center/export-focus/#put-finops-bucketexport-id

**Status:** Beta version  
**IAM actions:** `account:apiovh:finops/bucketExport/edit`

<sup>*</sup> S3 is a trademark filed by Amazon Technologies,Inc. OVHcloud's service is not sponsored by, endorsed by, or otherwise affiliated with Amazon Technologies,Inc.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Id |

### Request body (required)

Type: `finops.bucketExport.AsyncConfiguration`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string |  | Checksum of the Bucket Export Configuration |
| `currentState` | finops.bucketExport.Configuration | read-only | Current state of the billing account |
| `currentState.bucketConfiguration` | finops.bucketExport.BucketConfiguration |  | Configuration of the target bucket, which must be S3™*-compatible |
| `currentState.bucketConfiguration.accessKey` | string (password) | yes | S3™* access key |
| `currentState.bucketConfiguration.bucketName` | string | yes | Name of the bucket where the file will be put |
| `currentState.bucketConfiguration.endpointURL` | string | yes | Hostname used to reach the S3™* cluster |
| `currentState.bucketConfiguration.pathPrefix` | string |  | Folder where the files will be created |
| `currentState.bucketConfiguration.region` | string | yes | S3™* region name |
| `currentState.bucketConfiguration.secretKey` | string (password) | yes | S3™* secret key |
| `currentState.exportHour` | integer |  | The hour (in UTC) we will deposit the file at. For example, if set to 7, the export will be triggered starting at 7:00 UTC. Only applicable to period=DAILY. |
| `currentState.filePolicy` | finops.bucketExport.FilePolicyEnum |  | Strategy for file creation — one of `CREATE`, `REPLACE` |
| `currentState.period` | finops.bucketExport.PeriodEnum |  | The period at which your finops data will be exported. Defaults to DAILY. — one of `DAILY`, `HOURLY` |
| `currentState.scope` | string | read-only | Scope of this export |
| `currentTasks` | common.CurrentTask[] | read-only | Task to do on this billing account |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string | read-only | Unique identifier of the billing account |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Billing account readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | finops.bucketExport.Configuration |  | Target Spec for the FinOps Bucket Export Configuration |
| `targetSpec.bucketConfiguration` | finops.bucketExport.BucketConfiguration |  | Configuration of the target bucket, which must be S3™*-compatible |
| `targetSpec.bucketConfiguration.accessKey` | string (password) | yes | S3™* access key |
| `targetSpec.bucketConfiguration.bucketName` | string | yes | Name of the bucket where the file will be put |
| `targetSpec.bucketConfiguration.endpointURL` | string | yes | Hostname used to reach the S3™* cluster |
| `targetSpec.bucketConfiguration.pathPrefix` | string |  | Folder where the files will be created |
| `targetSpec.bucketConfiguration.region` | string | yes | S3™* region name |
| `targetSpec.bucketConfiguration.secretKey` | string (password) | yes | S3™* secret key |
| `targetSpec.exportHour` | integer |  | The hour (in UTC) we will deposit the file at. For example, if set to 7, the export will be triggered starting at 7:00 UTC. Only applicable to period=DAILY. |
| `targetSpec.filePolicy` | finops.bucketExport.FilePolicyEnum |  | Strategy for file creation — one of `CREATE`, `REPLACE` |
| `targetSpec.period` | finops.bucketExport.PeriodEnum |  | The period at which your finops data will be exported. Defaults to DAILY. — one of `DAILY`, `HOURLY` |
| `targetSpec.scope` | string | read-only | Scope of this export |

```json
{
  "checksum": "string",
  "targetSpec": {
    "bucketConfiguration": {
      "accessKey": "string",
      "bucketName": "string",
      "endpointURL": "string",
      "pathPrefix": "string",
      "region": "string",
      "secretKey": "string"
    },
    "exportHour": 0,
    "filePolicy": "CREATE",
    "period": "DAILY"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | finops.bucketExport.AsyncConfiguration | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string |  | Checksum of the Bucket Export Configuration |
| `currentState` | finops.bucketExport.Configuration | read-only | Current state of the billing account |
| `currentState.bucketConfiguration` | finops.bucketExport.BucketConfiguration |  | Configuration of the target bucket, which must be S3™*-compatible |
| `currentState.bucketConfiguration.accessKey` | string (password) | yes | S3™* access key |
| `currentState.bucketConfiguration.bucketName` | string | yes | Name of the bucket where the file will be put |
| `currentState.bucketConfiguration.endpointURL` | string | yes | Hostname used to reach the S3™* cluster |
| `currentState.bucketConfiguration.pathPrefix` | string |  | Folder where the files will be created |
| `currentState.bucketConfiguration.region` | string | yes | S3™* region name |
| `currentState.bucketConfiguration.secretKey` | string (password) | yes | S3™* secret key |
| `currentState.exportHour` | integer |  | The hour (in UTC) we will deposit the file at. For example, if set to 7, the export will be triggered starting at 7:00 UTC. Only applicable to period=DAILY. |
| `currentState.filePolicy` | finops.bucketExport.FilePolicyEnum |  | Strategy for file creation — one of `CREATE`, `REPLACE` |
| `currentState.period` | finops.bucketExport.PeriodEnum |  | The period at which your finops data will be exported. Defaults to DAILY. — one of `DAILY`, `HOURLY` |
| `currentState.scope` | string | read-only | Scope of this export |
| `currentTasks` | common.CurrentTask[] | read-only | Task to do on this billing account |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string | read-only | Unique identifier of the billing account |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Billing account readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | finops.bucketExport.Configuration |  | Target Spec for the FinOps Bucket Export Configuration |
| `targetSpec.bucketConfiguration` | finops.bucketExport.BucketConfiguration |  | Configuration of the target bucket, which must be S3™*-compatible |
| `targetSpec.bucketConfiguration.accessKey` | string (password) | yes | S3™* access key |
| `targetSpec.bucketConfiguration.bucketName` | string | yes | Name of the bucket where the file will be put |
| `targetSpec.bucketConfiguration.endpointURL` | string | yes | Hostname used to reach the S3™* cluster |
| `targetSpec.bucketConfiguration.pathPrefix` | string |  | Folder where the files will be created |
| `targetSpec.bucketConfiguration.region` | string | yes | S3™* region name |
| `targetSpec.bucketConfiguration.secretKey` | string (password) | yes | S3™* secret key |
| `targetSpec.exportHour` | integer |  | The hour (in UTC) we will deposit the file at. For example, if set to 7, the export will be triggered starting at 7:00 UTC. Only applicable to period=DAILY. |
| `targetSpec.filePolicy` | finops.bucketExport.FilePolicyEnum |  | Strategy for file creation — one of `CREATE`, `REPLACE` |
| `targetSpec.period` | finops.bucketExport.PeriodEnum |  | The period at which your finops data will be exported. Defaults to DAILY. — one of `DAILY`, `HOURLY` |
| `targetSpec.scope` | string | read-only | Scope of this export |

```json
{
  "checksum": "string",
  "currentState": {
    "bucketConfiguration": {
      "accessKey": "string",
      "bucketName": "string",
      "endpointURL": "string",
      "pathPrefix": "string",
      "region": "string",
      "secretKey": "string"
    },
    "exportHour": 0,
    "filePolicy": "CREATE",
    "period": "DAILY",
    "scope": "string"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "string",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "bucketConfiguration": {
      "accessKey": "string",
      "bucketName": "string",
      "endpointURL": "string",
      "pathPrefix": "string",
      "region": "string",
      "secretKey": "string"
    },
    "exportHour": 0,
    "filePolicy": "CREATE",
    "period": "DAILY",
    "scope": "string"
  }
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/finops/bucketExport/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: finops.bucketExport.AsyncConfiguration
result = client.put("/v2/finops/bucketExport/{id}",
	checksum = None, # Checksum of the Bucket Export Configuration (type: string)
	targetSpec = None, # Target Spec for the FinOps Bucket Export Configuration (type: finops.bucketExport.Configuration)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: finops.bucketExport.AsyncConfiguration
$result = $ovh->put("/v2/finops/bucketExport/{id}", array(
	checksum => null, // Checksum of the Bucket Export Configuration (type: string)
	targetSpec => null, // Target Spec for the FinOps Bucket Export Configuration (type: finops.bucketExport.Configuration)
));

print_r($result);
?>
```
