Initial commit.

This commit is contained in:
Pierre Lannoy 2025-03-03 16:35:54 +01:00
commit b6be743548
Signed by: Pierre Lannoy
GPG key ID: D27231EF87D53F31
93 changed files with 23955 additions and 0 deletions

544
docs/Api/SnapshotApi.md Normal file
View file

@ -0,0 +1,544 @@
# OpenAPI\Client\SnapshotApi
All URIs are relative to https://api.scaleway.com, except if the operation defines another base path.
| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**createSnapshot()**](SnapshotApi.md#createSnapshot) | **POST** /block/v1alpha1/zones/{zone}/snapshots | Create a snapshot of a volume |
| [**deleteSnapshot()**](SnapshotApi.md#deleteSnapshot) | **DELETE** /block/v1alpha1/zones/{zone}/snapshots/{snapshot_id} | Delete a snapshot |
| [**exportSnapshotToObjectStorage()**](SnapshotApi.md#exportSnapshotToObjectStorage) | **POST** /block/v1alpha1/zones/{zone}/snapshots/{snapshot_id}/export-to-object-storage | Export a snapshot to a Scaleway Object Storage bucket |
| [**getSnapshot()**](SnapshotApi.md#getSnapshot) | **GET** /block/v1alpha1/zones/{zone}/snapshots/{snapshot_id} | Get a snapshot |
| [**importSnapshotFromObjectStorage()**](SnapshotApi.md#importSnapshotFromObjectStorage) | **POST** /block/v1alpha1/zones/{zone}/snapshots/import-from-object-storage | Import a snapshot from a Scaleway Object Storage bucket |
| [**importSnapshotFromS3()**](SnapshotApi.md#importSnapshotFromS3) | **POST** /block/v1alpha1/zones/{zone}/snapshots/import-from-s3 | (Deprecated in favor of `ImportSnapshotFromObjectStorage`) |
| [**listSnapshots()**](SnapshotApi.md#listSnapshots) | **GET** /block/v1alpha1/zones/{zone}/snapshots | List all snapshots |
| [**updateSnapshot()**](SnapshotApi.md#updateSnapshot) | **PATCH** /block/v1alpha1/zones/{zone}/snapshots/{snapshot_id} | Update a snapshot |
## `createSnapshot()`
```php
createSnapshot($zone, $create_snapshot_request): \OpenAPI\Client\Model\ScalewayBlockV1alpha1Snapshot
```
Create a snapshot of a volume
To create a snapshot, the volume must be in the `in_use` or the `available` status. If your volume is in a transient state, you need to wait until the end of the current operation.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: scaleway
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\SnapshotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$zone = 'zone_example'; // string | The zone you want to target
$create_snapshot_request = new \OpenAPI\Client\Model\CreateSnapshotRequest(); // \OpenAPI\Client\Model\CreateSnapshotRequest
try {
$result = $apiInstance->createSnapshot($zone, $create_snapshot_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SnapshotApi->createSnapshot: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **zone** | **string**| The zone you want to target | |
| **create_snapshot_request** | [**\OpenAPI\Client\Model\CreateSnapshotRequest**](../Model/CreateSnapshotRequest.md)| | |
### Return type
[**\OpenAPI\Client\Model\ScalewayBlockV1alpha1Snapshot**](../Model/ScalewayBlockV1alpha1Snapshot.md)
### Authorization
[scaleway](../../README.md#scaleway)
### HTTP request headers
- **Content-Type**: `application/json`
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `deleteSnapshot()`
```php
deleteSnapshot($zone, $snapshot_id)
```
Delete a snapshot
You must specify the `snapshot_id` of the snapshot you want to delete. The snapshot must not be in use.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: scaleway
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\SnapshotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$zone = 'zone_example'; // string | The zone you want to target
$snapshot_id = 'snapshot_id_example'; // string | UUID of the snapshot.
try {
$apiInstance->deleteSnapshot($zone, $snapshot_id);
} catch (Exception $e) {
echo 'Exception when calling SnapshotApi->deleteSnapshot: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **zone** | **string**| The zone you want to target | |
| **snapshot_id** | **string**| UUID of the snapshot. | |
### Return type
void (empty response body)
### Authorization
[scaleway](../../README.md#scaleway)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `exportSnapshotToObjectStorage()`
```php
exportSnapshotToObjectStorage($zone, $snapshot_id, $export_snapshot_to_object_storage_request): \OpenAPI\Client\Model\ScalewayBlockV1alpha1Snapshot
```
Export a snapshot to a Scaleway Object Storage bucket
The snapshot is exported in QCOW2 format. The snapshot must not be in transient state.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: scaleway
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\SnapshotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$zone = 'zone_example'; // string | The zone you want to target
$snapshot_id = 6170692e-7363-616c-6577-61792e636f6d; // string | UUID of the snapshot. (UUID format)
$export_snapshot_to_object_storage_request = new \OpenAPI\Client\Model\ExportSnapshotToObjectStorageRequest(); // \OpenAPI\Client\Model\ExportSnapshotToObjectStorageRequest
try {
$result = $apiInstance->exportSnapshotToObjectStorage($zone, $snapshot_id, $export_snapshot_to_object_storage_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SnapshotApi->exportSnapshotToObjectStorage: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **zone** | **string**| The zone you want to target | |
| **snapshot_id** | **string**| UUID of the snapshot. (UUID format) | |
| **export_snapshot_to_object_storage_request** | [**\OpenAPI\Client\Model\ExportSnapshotToObjectStorageRequest**](../Model/ExportSnapshotToObjectStorageRequest.md)| | |
### Return type
[**\OpenAPI\Client\Model\ScalewayBlockV1alpha1Snapshot**](../Model/ScalewayBlockV1alpha1Snapshot.md)
### Authorization
[scaleway](../../README.md#scaleway)
### HTTP request headers
- **Content-Type**: `application/json`
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `getSnapshot()`
```php
getSnapshot($zone, $snapshot_id): \OpenAPI\Client\Model\ScalewayBlockV1alpha1Snapshot
```
Get a snapshot
Retrieve technical information about a specific snapshot. Details such as size, volume type, and status are returned in the response.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: scaleway
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\SnapshotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$zone = 'zone_example'; // string | The zone you want to target
$snapshot_id = 'snapshot_id_example'; // string | UUID of the snapshot.
try {
$result = $apiInstance->getSnapshot($zone, $snapshot_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SnapshotApi->getSnapshot: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **zone** | **string**| The zone you want to target | |
| **snapshot_id** | **string**| UUID of the snapshot. | |
### Return type
[**\OpenAPI\Client\Model\ScalewayBlockV1alpha1Snapshot**](../Model/ScalewayBlockV1alpha1Snapshot.md)
### Authorization
[scaleway](../../README.md#scaleway)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `importSnapshotFromObjectStorage()`
```php
importSnapshotFromObjectStorage($zone, $import_snapshot_from_object_storage_request): \OpenAPI\Client\Model\ScalewayBlockV1alpha1Snapshot
```
Import a snapshot from a Scaleway Object Storage bucket
The bucket must contain a QCOW2 image. The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: scaleway
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\SnapshotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$zone = 'zone_example'; // string | The zone you want to target
$import_snapshot_from_object_storage_request = new \OpenAPI\Client\Model\ImportSnapshotFromObjectStorageRequest(); // \OpenAPI\Client\Model\ImportSnapshotFromObjectStorageRequest
try {
$result = $apiInstance->importSnapshotFromObjectStorage($zone, $import_snapshot_from_object_storage_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SnapshotApi->importSnapshotFromObjectStorage: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **zone** | **string**| The zone you want to target | |
| **import_snapshot_from_object_storage_request** | [**\OpenAPI\Client\Model\ImportSnapshotFromObjectStorageRequest**](../Model/ImportSnapshotFromObjectStorageRequest.md)| | |
### Return type
[**\OpenAPI\Client\Model\ScalewayBlockV1alpha1Snapshot**](../Model/ScalewayBlockV1alpha1Snapshot.md)
### Authorization
[scaleway](../../README.md#scaleway)
### HTTP request headers
- **Content-Type**: `application/json`
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `importSnapshotFromS3()`
```php
importSnapshotFromS3($zone, $import_snapshot_from_object_storage_request): \OpenAPI\Client\Model\ScalewayBlockV1alpha1Snapshot
```
(Deprecated in favor of `ImportSnapshotFromObjectStorage`)
Import a snapshot from a Scaleway Object Storage bucket The bucket must contain a QCOW2 image. The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: scaleway
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\SnapshotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$zone = 'zone_example'; // string | The zone you want to target
$import_snapshot_from_object_storage_request = new \OpenAPI\Client\Model\ImportSnapshotFromObjectStorageRequest(); // \OpenAPI\Client\Model\ImportSnapshotFromObjectStorageRequest
try {
$result = $apiInstance->importSnapshotFromS3($zone, $import_snapshot_from_object_storage_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SnapshotApi->importSnapshotFromS3: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **zone** | **string**| The zone you want to target | |
| **import_snapshot_from_object_storage_request** | [**\OpenAPI\Client\Model\ImportSnapshotFromObjectStorageRequest**](../Model/ImportSnapshotFromObjectStorageRequest.md)| | |
### Return type
[**\OpenAPI\Client\Model\ScalewayBlockV1alpha1Snapshot**](../Model/ScalewayBlockV1alpha1Snapshot.md)
### Authorization
[scaleway](../../README.md#scaleway)
### HTTP request headers
- **Content-Type**: `application/json`
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `listSnapshots()`
```php
listSnapshots($zone, $order_by, $project_id, $organization_id, $page, $page_size, $volume_id, $name, $tags): \OpenAPI\Client\Model\ScalewayBlockV1alpha1ListSnapshotsResponse
```
List all snapshots
List all available snapshots in a specified zone. By default, the snapshots listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: scaleway
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\SnapshotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$zone = 'zone_example'; // string | The zone you want to target
$order_by = 'created_at_asc'; // string | Criteria to use when ordering the list.
$project_id = 'project_id_example'; // string | Filter by Project ID.
$organization_id = 'organization_id_example'; // string | Filter by Organization ID.
$page = 56; // int | Page number.
$page_size = 50; // int | Page size, defines how many entries are returned in one page, must be lower or equal to 100.
$volume_id = 'volume_id_example'; // string | Filter snapshots by the ID of the original volume.
$name = 'name_example'; // string | Filter snapshots by their names.
$tags = array('tags_example'); // string[] | Filter by tags. Only snapshots with one or more matching tags will be returned.
try {
$result = $apiInstance->listSnapshots($zone, $order_by, $project_id, $organization_id, $page, $page_size, $volume_id, $name, $tags);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SnapshotApi->listSnapshots: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **zone** | **string**| The zone you want to target | |
| **order_by** | **string**| Criteria to use when ordering the list. | [optional] [default to &#39;created_at_asc&#39;] |
| **project_id** | **string**| Filter by Project ID. | [optional] |
| **organization_id** | **string**| Filter by Organization ID. | [optional] |
| **page** | **int**| Page number. | [optional] |
| **page_size** | **int**| Page size, defines how many entries are returned in one page, must be lower or equal to 100. | [optional] [default to 50] |
| **volume_id** | **string**| Filter snapshots by the ID of the original volume. | [optional] |
| **name** | **string**| Filter snapshots by their names. | [optional] |
| **tags** | [**string[]**](../Model/string.md)| Filter by tags. Only snapshots with one or more matching tags will be returned. | [optional] |
### Return type
[**\OpenAPI\Client\Model\ScalewayBlockV1alpha1ListSnapshotsResponse**](../Model/ScalewayBlockV1alpha1ListSnapshotsResponse.md)
### Authorization
[scaleway](../../README.md#scaleway)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `updateSnapshot()`
```php
updateSnapshot($zone, $snapshot_id, $update_snapshot_request): \OpenAPI\Client\Model\ScalewayBlockV1alpha1Snapshot
```
Update a snapshot
Update the name or tags of the snapshot.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: scaleway
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\SnapshotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$zone = 'zone_example'; // string | The zone you want to target
$snapshot_id = 'snapshot_id_example'; // string | UUID of the snapshot.
$update_snapshot_request = new \OpenAPI\Client\Model\UpdateSnapshotRequest(); // \OpenAPI\Client\Model\UpdateSnapshotRequest
try {
$result = $apiInstance->updateSnapshot($zone, $snapshot_id, $update_snapshot_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SnapshotApi->updateSnapshot: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **zone** | **string**| The zone you want to target | |
| **snapshot_id** | **string**| UUID of the snapshot. | |
| **update_snapshot_request** | [**\OpenAPI\Client\Model\UpdateSnapshotRequest**](../Model/UpdateSnapshotRequest.md)| | |
### Return type
[**\OpenAPI\Client\Model\ScalewayBlockV1alpha1Snapshot**](../Model/ScalewayBlockV1alpha1Snapshot.md)
### Authorization
[scaleway](../../README.md#scaleway)
### HTTP request headers
- **Content-Type**: `application/json`
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

347
docs/Api/VolumeApi.md Normal file
View file

@ -0,0 +1,347 @@
# OpenAPI\Client\VolumeApi
All URIs are relative to https://api.scaleway.com, except if the operation defines another base path.
| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**createVolume()**](VolumeApi.md#createVolume) | **POST** /block/v1alpha1/zones/{zone}/volumes | Create a volume |
| [**deleteVolume()**](VolumeApi.md#deleteVolume) | **DELETE** /block/v1alpha1/zones/{zone}/volumes/{volume_id} | Delete a detached volume |
| [**getVolume()**](VolumeApi.md#getVolume) | **GET** /block/v1alpha1/zones/{zone}/volumes/{volume_id} | Get a volume |
| [**listVolumes()**](VolumeApi.md#listVolumes) | **GET** /block/v1alpha1/zones/{zone}/volumes | List volumes |
| [**updateVolume()**](VolumeApi.md#updateVolume) | **PATCH** /block/v1alpha1/zones/{zone}/volumes/{volume_id} | Update a volume |
## `createVolume()`
```php
createVolume($zone, $create_volume_request): \OpenAPI\Client\Model\ScalewayBlockV1alpha1Volume
```
Create a volume
To create a new volume from scratch, you must specify `from_empty` and the `size`. To create a volume from an existing snapshot, specify `from_snapshot` and the `snapshot_id` in the request payload instead, size is optional and can be specified if you need to extend the original size. The volume will take on the same volume class and underlying IOPS limitations as the original snapshot.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: scaleway
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\VolumeApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$zone = 'zone_example'; // string | The zone you want to target
$create_volume_request = new \OpenAPI\Client\Model\CreateVolumeRequest(); // \OpenAPI\Client\Model\CreateVolumeRequest
try {
$result = $apiInstance->createVolume($zone, $create_volume_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling VolumeApi->createVolume: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **zone** | **string**| The zone you want to target | |
| **create_volume_request** | [**\OpenAPI\Client\Model\CreateVolumeRequest**](../Model/CreateVolumeRequest.md)| | |
### Return type
[**\OpenAPI\Client\Model\ScalewayBlockV1alpha1Volume**](../Model/ScalewayBlockV1alpha1Volume.md)
### Authorization
[scaleway](../../README.md#scaleway)
### HTTP request headers
- **Content-Type**: `application/json`
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `deleteVolume()`
```php
deleteVolume($zone, $volume_id)
```
Delete a detached volume
You must specify the `volume_id` of the volume you want to delete. The volume must not be in the `in_use` status.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: scaleway
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\VolumeApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$zone = 'zone_example'; // string | The zone you want to target
$volume_id = 'volume_id_example'; // string | UUID of the volume.
try {
$apiInstance->deleteVolume($zone, $volume_id);
} catch (Exception $e) {
echo 'Exception when calling VolumeApi->deleteVolume: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **zone** | **string**| The zone you want to target | |
| **volume_id** | **string**| UUID of the volume. | |
### Return type
void (empty response body)
### Authorization
[scaleway](../../README.md#scaleway)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `getVolume()`
```php
getVolume($zone, $volume_id): \OpenAPI\Client\Model\ScalewayBlockV1alpha1Volume
```
Get a volume
Retrieve technical information about a specific volume. Details such as size, type, and status are returned in the response.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: scaleway
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\VolumeApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$zone = 'zone_example'; // string | The zone you want to target
$volume_id = 'volume_id_example'; // string | UUID of the volume.
try {
$result = $apiInstance->getVolume($zone, $volume_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling VolumeApi->getVolume: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **zone** | **string**| The zone you want to target | |
| **volume_id** | **string**| UUID of the volume. | |
### Return type
[**\OpenAPI\Client\Model\ScalewayBlockV1alpha1Volume**](../Model/ScalewayBlockV1alpha1Volume.md)
### Authorization
[scaleway](../../README.md#scaleway)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `listVolumes()`
```php
listVolumes($zone, $order_by, $project_id, $organization_id, $page, $page_size, $name, $product_resource_id, $tags): \OpenAPI\Client\Model\ScalewayBlockV1alpha1ListVolumesResponse
```
List volumes
List all existing volumes in a specified zone. By default, the volumes listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: scaleway
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\VolumeApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$zone = 'zone_example'; // string | The zone you want to target
$order_by = 'created_at_asc'; // string | Criteria to use when ordering the list.
$project_id = 'project_id_example'; // string | Filter by Project ID.
$organization_id = 'organization_id_example'; // string | Filter by Organization ID.
$page = 56; // int | Page number.
$page_size = 50; // int | Page size, defines how many entries are returned in one page, must be lower or equal to 100.
$name = 'name_example'; // string | Filter the return volumes by their names.
$product_resource_id = 'product_resource_id_example'; // string | Filter by a product resource ID linked to this volume (such as an Instance ID).
$tags = array('tags_example'); // string[] | Filter by tags. Only volumes with one or more matching tags will be returned.
try {
$result = $apiInstance->listVolumes($zone, $order_by, $project_id, $organization_id, $page, $page_size, $name, $product_resource_id, $tags);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling VolumeApi->listVolumes: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **zone** | **string**| The zone you want to target | |
| **order_by** | **string**| Criteria to use when ordering the list. | [optional] [default to &#39;created_at_asc&#39;] |
| **project_id** | **string**| Filter by Project ID. | [optional] |
| **organization_id** | **string**| Filter by Organization ID. | [optional] |
| **page** | **int**| Page number. | [optional] |
| **page_size** | **int**| Page size, defines how many entries are returned in one page, must be lower or equal to 100. | [optional] [default to 50] |
| **name** | **string**| Filter the return volumes by their names. | [optional] |
| **product_resource_id** | **string**| Filter by a product resource ID linked to this volume (such as an Instance ID). | [optional] |
| **tags** | [**string[]**](../Model/string.md)| Filter by tags. Only volumes with one or more matching tags will be returned. | [optional] |
### Return type
[**\OpenAPI\Client\Model\ScalewayBlockV1alpha1ListVolumesResponse**](../Model/ScalewayBlockV1alpha1ListVolumesResponse.md)
### Authorization
[scaleway](../../README.md#scaleway)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
## `updateVolume()`
```php
updateVolume($zone, $volume_id, $update_volume_request): \OpenAPI\Client\Model\ScalewayBlockV1alpha1Volume
```
Update a volume
Update the technical details of a volume, such as its name, tags, or its new size and `volume_type` (within the same Block Storage class). You can only resize a volume to a larger size. It is currently not possible to change your Block Storage Class.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: scaleway
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\VolumeApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$zone = 'zone_example'; // string | The zone you want to target
$volume_id = 'volume_id_example'; // string | UUID of the volume.
$update_volume_request = new \OpenAPI\Client\Model\UpdateVolumeRequest(); // \OpenAPI\Client\Model\UpdateVolumeRequest
try {
$result = $apiInstance->updateVolume($zone, $volume_id, $update_volume_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling VolumeApi->updateVolume: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **zone** | **string**| The zone you want to target | |
| **volume_id** | **string**| UUID of the volume. | |
| **update_volume_request** | [**\OpenAPI\Client\Model\UpdateVolumeRequest**](../Model/UpdateVolumeRequest.md)| | |
### Return type
[**\OpenAPI\Client\Model\ScalewayBlockV1alpha1Volume**](../Model/ScalewayBlockV1alpha1Volume.md)
### Authorization
[scaleway](../../README.md#scaleway)
### HTTP request headers
- **Content-Type**: `application/json`
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

74
docs/Api/VolumeTypeApi.md Normal file
View file

@ -0,0 +1,74 @@
# OpenAPI\Client\VolumeTypeApi
All URIs are relative to https://api.scaleway.com, except if the operation defines another base path.
| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**listVolumeTypes()**](VolumeTypeApi.md#listVolumeTypes) | **GET** /block/v1alpha1/zones/{zone}/volume-types | List volume types |
## `listVolumeTypes()`
```php
listVolumeTypes($zone, $page, $page_size): \OpenAPI\Client\Model\ScalewayBlockV1alpha1ListVolumeTypesResponse
```
List volume types
List all available volume types in a specified zone. The volume types listed are ordered by name in ascending order.
### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: scaleway
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\VolumeTypeApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$zone = 'zone_example'; // string | The zone you want to target
$page = 56; // int | Page number.
$page_size = 50; // int | Page size, defines how many entries are returned in one page, must be lower or equal to 100.
try {
$result = $apiInstance->listVolumeTypes($zone, $page, $page_size);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling VolumeTypeApi->listVolumeTypes: ', $e->getMessage(), PHP_EOL;
}
```
### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **zone** | **string**| The zone you want to target | |
| **page** | **int**| Page number. | [optional] |
| **page_size** | **int**| Page size, defines how many entries are returned in one page, must be lower or equal to 100. | [optional] [default to 50] |
### Return type
[**\OpenAPI\Client\Model\ScalewayBlockV1alpha1ListVolumeTypesResponse**](../Model/ScalewayBlockV1alpha1ListVolumeTypesResponse.md)
### Authorization
[scaleway](../../README.md#scaleway)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)