mysqls
Creates, updates, deletes, gets or lists a mysqls resource.
Overview​
| Name | mysqls |
| Type | Resource |
| Id | ovh.public_cloud_database.mysqls |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique identifier of the service |
checksum | string | Hash of the resource used for concurrency control |
created_at | string (date-time) | Date at which the service was created (wire: createdAt) |
current_state | object | Current configuration deployed on the service (wire: currentState) |
current_tasks | array | Asynchronous operations currently running on the service (wire: currentTasks) |
resource_status | string | Readiness status of the service. A new target specification is accepted only in READY status. (CREATING, CREATION_PLANNED, DELETING, ERROR, OUT_OF_SYNC, READY, SUSPENDED, UNKNOWN, UPDATING) (wire: resourceStatus) |
target_spec | object | Last requested target specification for the service (wire: targetSpec) |
updated_at | string (date-time) | Date of the last update to the service (wire: updatedAt) |
A managed database service
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique identifier of the service |
checksum | string | Hash of the resource used for concurrency control |
created_at | string (date-time) | Date at which the service was created (wire: createdAt) |
current_state | object | Current configuration deployed on the service (wire: currentState) |
current_tasks | array | Asynchronous operations currently running on the service (wire: currentTasks) |
resource_status | string | Readiness status of the service. A new target specification is accepted only in READY status. (CREATING, CREATION_PLANNED, DELETING, ERROR, OUT_OF_SYNC, READY, SUSPENDED, UNKNOWN, UPDATING) (wire: resourceStatus) |
target_spec | object | Last requested target specification for the service (wire: targetSpec) |
updated_at | string (date-time) | Date of the last update to the service (wire: updatedAt) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_id, project_id | Returns the target specification of the service, its current state and its running tasks. (Beta version) | |
list | select | project_id | x_pagination_cursor, x_pagination_size | Returns the MySQL services of the project. (Beta version) |
create | insert | project_id, target_spec | Creates a MySQL service from a plan, a flavor and an engine version. Creation is asynchronous: follow resourceStatus until READY. Set forkSourceServiceId to create it from a backup of another service. (Beta version) | |
update | update | service_id, project_id, target_spec | Partially updates the target specification of the service, for example its plan, flavor, version or number of nodes. Omitted fields keep their current value. A new target specification is accepted only in READY status. (Beta version) | |
delete | delete | service_id, project_id | Deletes the service. A service with deletion protection enabled cannot be deleted. (Beta version) | |
replace | exec | serviceId, project_id, targetSpec | Updates the target specification of the service, for example its plan, flavor, version or number of nodes. Every field is required: the request describes the whole configuration. A new target specification is accepted only in READY status. (Beta version) | |
enable_writes | exec | serviceId, project_id | Enables temporary write permissions on a service locked in read-only mode because its disk is full. Returns the date when they are revoked. (Beta version) | |
log_url | exec | serviceId, project_id, kind | Generates a temporary URL to read the logs of one kind. The URL expires. (Beta version) |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}}) |
project_id | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
serviceId | string (uuid) | Service ID |
service_id | string (uuid) | Service ID (wire: serviceId) |
x_pagination_cursor | string | Pagination cursor (wire: X-Pagination-Cursor) |
x_pagination_size | integer | Pagination size (wire: X-Pagination-Size) |
SELECT examples​
- get
- list
Returns the target specification of the service, its current state and its running tasks. (Beta version)
SELECT
id,
checksum,
created_at,
current_state,
current_tasks,
resource_status,
target_spec,
updated_at
FROM ovh.public_cloud_database.mysqls
WHERE service_id = '{{ service_id }}' -- required
AND project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;
Returns the MySQL services of the project. (Beta version)
SELECT
id,
checksum,
created_at,
current_state,
current_tasks,
resource_status,
target_spec,
updated_at
FROM ovh.public_cloud_database.mysqls
WHERE project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND x_pagination_cursor = '{{ x_pagination_cursor }}'
AND x_pagination_size = '{{ x_pagination_size }}'
;
INSERT examples​
- create
- Manifest
Creates a MySQL service from a plan, a flavor and an engine version. Creation is asynchronous: follow resourceStatus until READY. Set forkSourceServiceId to create it from a backup of another service. (Beta version)
INSERT INTO ovh.public_cloud_database.mysqls (
target_spec,
project_id
)
SELECT
'{{ target_spec }}' /* required */,
'{{ project_id }}'
RETURNING
id,
checksum,
created_at,
current_state,
current_tasks,
resource_status,
target_spec,
updated_at
;
# Description fields are for documentation purposes
- name: mysqls
props:
- name: project_id
value: "{{ project_id }}"
description: Required parameter for the mysqls resource.
- name: target_spec
description: |
Desired configuration of the new service
value:
backup:
regions:
- "{{ regions }}"
time: "{{ time }}"
deletionProtected: {{ deletionProtected }}
description: "{{ description }}"
flavor: "{{ flavor }}"
forkSourceBackupId: "{{ forkSourceBackupId }}"
forkSourcePointInTime: "{{ forkSourcePointInTime }}"
forkSourceServiceId: "{{ forkSourceServiceId }}"
maintenanceWindow:
startTimeUtc: "{{ startTimeUtc }}"
network:
authorizedIps:
rules:
- cidr: "{{ cidr }}"
createdAt: "{{ createdAt }}"
description: "{{ description }}"
networkId: "{{ networkId }}"
public: {{ public }}
subnetId: "{{ subnetId }}"
nodesCount: {{ nodesCount }}
plan: "{{ plan }}"
prometheusEnabled: {{ prometheusEnabled }}
region: "{{ region }}"
storage:
size:
unit: "{{ unit }}"
value: {{ value }}
type: "{{ type }}"
version: "{{ version }}"
UPDATE examples​
- update
Partially updates the target specification of the service, for example its plan, flavor, version or number of nodes. Omitted fields keep their current value. A new target specification is accepted only in READY status. (Beta version)
UPDATE ovh.public_cloud_database.mysqls
SET
target_spec = '{{ target_spec }}'
WHERE
service_id = '{{ service_id }}' --required
AND project_id = '{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
AND target_spec = '{{ target_spec }}' --required
RETURNING
id,
checksum,
created_at,
current_state,
current_tasks,
resource_status,
target_spec,
updated_at;
DELETE examples​
- delete
Deletes the service. A service with deletion protection enabled cannot be deleted. (Beta version)
DELETE FROM ovh.public_cloud_database.mysqls
WHERE service_id = '{{ service_id }}' --required
AND project_id = '{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- replace
- enable_writes
- log_url
Updates the target specification of the service, for example its plan, flavor, version or number of nodes. Every field is required: the request describes the whole configuration. A new target specification is accepted only in READY status. (Beta version)
EXEC ovh.public_cloud_database.mysqls.replace
@serviceId='{{ serviceId }}' --required,
@project_id='{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
@@json=
'{
"targetSpec": "{{ targetSpec }}"
}'
;
Enables temporary write permissions on a service locked in read-only mode because its disk is full. Returns the date when they are revoked. (Beta version)
EXEC ovh.public_cloud_database.mysqls.enable_writes
@serviceId='{{ serviceId }}' --required,
@project_id='{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;
Generates a temporary URL to read the logs of one kind. The URL expires. (Beta version)
EXEC ovh.public_cloud_database.mysqls.log_url
@serviceId='{{ serviceId }}' --required,
@project_id='{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
@@json=
'{
"kind": "{{ kind }}"
}'
;