{"openapi":"3.0.0","info":{"title":"OVHcloud API specification","description":"Specification for OVHcloud API","version":"1.0","contact":{"name":"OVH","email":"api@ml.ovh.net"}},"servers":[{"url":"https://api.eu.ovhcloud.com/v2"}],"components":{"schemas":{"any":{"description":"Can be anything (text, int, bool, json, html, etc.)","example":"This is a content of any type !"},"duration":{"type":"string","description":"Duration (e.g., P1Y2M3DT4H6M9S)","example":"P1Y2M3DT4H6M9S"},"email":{"type":"string","description":"Email address (e.g., api@ml.ovh.net)","format":"email","example":"api@ml.ovh.net"},"internationalPhoneNumber":{"type":"string","description":"International phone number","format":"phone-number"},"ip":{"type":"string","description":"IP address (e.g., 192.0.2.0)","format":"ipv4","example":"192.0.2.0"},"ipBlock":{"type":"string","description":"IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24)","format":"ip-block","example":"192.0.2.0/24"},"ipInterface":{"type":"string","description":"IP address (e.g., 192.0.2.0)","format":"ipv4","example":"192.0.2.0"},"ipv4":{"type":"string","description":"IPv4 address (e.g., 192.0.2.0)","format":"ipv4","example":"192.0.2.0"},"ipv4Block":{"type":"string","description":"IPv4 CIDR notation (e.g., 192.0.2.0/24)","format":"ipv4-block","example":"192.0.2.0/24"},"ipv6":{"type":"string","description":"IPv6 address (e.g., 2001:41d0:1:1994::1)","format":"ipv6","example":"2001:41d0:1:1994::1"},"ipv6Block":{"type":"string","description":"IPv6 CIDR notation (e.g., 2001:41d0::/128)","format":"ipv6-block","example":"2001:41d0::/128"},"macAddress":{"type":"string","description":"MAC address (e.g., 00:00:5e:00:53:01)","format":"mac-address","example":"00:00:5e:00:53:01"},"phoneNumber":{"type":"string","description":"Phone number","format":"phone-number"},"publicCloud.database.CurrentQuery":{"type":"object","description":"A currently running query on a managed database service","properties":{"applicationName":{"type":"string","description":"Name of the application that initiated the query","nullable":true,"readOnly":true},"backendStartedAt":{"type":"string","description":"Timestamp when the backend process started","nullable":true,"format":"date-time","readOnly":true},"clientIp":{"allOf":[{"$ref":"#/components/schemas/ip"}],"description":"IP address of the client","nullable":true,"readOnly":true},"clientPort":{"type":"integer","description":"Port of the client connection","nullable":true,"readOnly":true},"databaseName":{"type":"string","description":"Name of the database the query is running on","readOnly":true},"pid":{"type":"integer","description":"Process ID of the connection","readOnly":true},"query":{"type":"string","description":"SQL text of the currently running query","readOnly":true},"queryDuration":{"type":"number","description":"Duration of the query in seconds","readOnly":true},"queryStartedAt":{"type":"string","description":"Timestamp when the query started","nullable":true,"format":"date-time","readOnly":true},"state":{"allOf":[{"$ref":"#/components/schemas/publicCloud.database.CurrentQueryStateEnum"}],"description":"Current state of the connection","readOnly":true},"userName":{"type":"string","description":"Name of the user running the query","readOnly":true},"waitEvent":{"type":"string","description":"Name of the wait event the connection is waiting on, if any","nullable":true,"readOnly":true},"waitEventType":{"allOf":[{"$ref":"#/components/schemas/publicCloud.database.CurrentQueryWaitEventTypeEnum"}],"description":"Type of wait event the connection is waiting on, if any","nullable":true,"readOnly":true}}},"publicCloud.database.CurrentQueryStateEnum":{"type":"string","description":"Possible states of a currently running query","enum":["ACTIVE","DISABLED","FASTPATH_FUNCTION_CALL","IDLE","IDLE_IN_TRANSACTION","IDLE_IN_TRANSACTION_ABORTED"]},"publicCloud.database.CurrentQueryWaitEventTypeEnum":{"type":"string","description":"Possible event types on which a database connection backend is waiting","enum":["ACTIVITY","BUFFER_PIN","CLIENT","EXTENSION","IO","IPC","LOCK","LWLOCK","TIMEOUT"]},"publicCloud.database.QueryCancelRequest":{"type":"object","description":"Request to cancel a running query","properties":{"terminate":{"type":"boolean","description":"Whether to forcefully terminate the query instead of gracefully canceling it","nullable":true}}},"publicCloud.database.QueryCancelResult":{"type":"object","description":"Result of a query cancellation request","properties":{"success":{"type":"boolean","description":"Whether the query was successfully canceled","readOnly":true}}},"publicCloud.database.QueryStatistic":{"type":"object","description":"Statistics for a single query pattern on a managed database service","properties":{"calls":{"type":"integer","description":"Number of times this query pattern has been executed","readOnly":true},"databaseName":{"type":"string","description":"Name of the database","nullable":true,"readOnly":true},"digest":{"type":"string","description":"Digest hash of the normalized query","readOnly":true},"firstSeen":{"type":"string","description":"Timestamp of the first execution","nullable":true,"format":"date-time","readOnly":true},"lastSeen":{"type":"string","description":"Timestamp of the most recent execution","nullable":true,"format":"date-time","readOnly":true},"maxTime":{"type":"number","description":"Maximum execution time in milliseconds","readOnly":true},"meanTime":{"type":"number","description":"Mean execution time in milliseconds","readOnly":true},"minTime":{"type":"number","description":"Minimum execution time in milliseconds","readOnly":true},"query":{"type":"string","description":"Representative SQL text of the query pattern","readOnly":true},"rows":{"type":"integer","description":"Total number of rows retrieved or affected","nullable":true,"readOnly":true},"totalTime":{"type":"number","description":"Total cumulative execution time in milliseconds","readOnly":true},"username":{"type":"string","description":"Name of the user who executed the query","nullable":true,"readOnly":true}}},"time":{"type":"string","description":"Time (e.g., 15:04:05)","format":"time","example":"15:04:05"}},"securitySchemes":{"oAuth2AuthCode":{"type":"oauth2","description":"Oauth2","x-client-id":"1bb9c7df371741c0","x-client-secret":"a5b4de870aca620d10fbf63cd18d205b","flows":{"authorizationCode":{"authorizationUrl":"https://auth.eu.ovhcloud.com/oauth2/authorize","tokenUrl":"https://auth.eu.ovhcloud.com/oauth2/token","scopes":{"account/all":"Manage your account","all":"Manage your whole account and all your services","services/all":"Manage your services lifecycle and billing"}}}}}},"paths":{"/publicCloud/project/{projectId}/managedDatabase/mysql/{serviceId}/currentQueries":{"get":{"operationId":"getAllMysqlCurrentQueries","summary":"List running queries","description":"Returns the queries running on the service, with their client, user, state and duration.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"header","name":"X-Pagination-Cursor","description":"Pagination cursor","schema":{"type":"string"}},{"in":"header","name":"X-Pagination-Size","description":"Pagination size","schema":{"type":"integer"}},{"in":"path","name":"projectId","description":"Project ID","required":true,"schema":{"type":"string"}},{"in":"path","name":"serviceId","description":"Service ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/publicCloud.database.CurrentQuery"}}}}}},"tags":["Managed Databases","MySQL"],"x-developer-hub-navigation":[["Public Cloud","Databases","MySQL","Queries@@@10"]],"x-badges":[{"color":"blue","label":"Beta version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.get(\"/v2/publicCloud/project/{projectId}/managedDatabase/mysql/{serviceId}/currentQueries\")\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->get(\"/v2/publicCloud/project/{projectId}/managedDatabase/mysql/{serviceId}/currentQueries\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:database/mysql/currentQueries/get","required":true}],"x-response-identifier":"pid","x-expanded-response":"PublicCloudDatabaseCurrentQuery"}},"/publicCloud/project/{projectId}/managedDatabase/mysql/{serviceId}/currentQueries/{queryPid}":{"get":{"operationId":"getMysqlCurrentQuery","summary":"Get a running query","description":"Returns the SQL text, state and duration of a running query, identified by its process ID.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"query","name":"limit","description":"Maximum number of queries to return","schema":{"type":"integer"}},{"in":"query","name":"offset","description":"Number of queries to skip before returning results","schema":{"type":"integer"}},{"in":"path","name":"projectId","description":"Project ID","required":true,"schema":{"type":"string"}},{"in":"path","name":"queryPid","description":"Query pid","required":true,"schema":{"type":"integer"}},{"in":"path","name":"serviceId","description":"Service ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.database.CurrentQuery"}}}}},"tags":["Managed Databases","MySQL"],"x-developer-hub-navigation":[["Public Cloud","Databases","MySQL","Queries@@@20"]],"x-badges":[{"color":"blue","label":"Beta version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.get(\"/v2/publicCloud/project/{projectId}/managedDatabase/mysql/{serviceId}/currentQueries/{queryPid}\")\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->get(\"/v2/publicCloud/project/{projectId}/managedDatabase/mysql/{serviceId}/currentQueries/{queryPid}\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:database/mysql/currentQueries/get","required":true}],"x-response-identifier":"pid"}},"/publicCloud/project/{projectId}/managedDatabase/mysql/{serviceId}/currentQueries/{queryPid}/cancel":{"post":{"operationId":"cancelMysqlCurrentQuery","summary":"Cancel a running query","description":"Cancels a running query gracefully. Set terminate to true to force its termination instead.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"projectId","description":"Project ID","required":true,"schema":{"type":"string"}},{"in":"path","name":"queryPid","description":"Query pid","required":true,"schema":{"type":"integer"}},{"in":"path","name":"serviceId","description":"Service ID","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.database.QueryCancelRequest"}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.database.QueryCancelResult"}}}}},"tags":["Managed Databases","MySQL"],"x-developer-hub-navigation":[["Public Cloud","Databases","MySQL","Queries@@@30"]],"x-badges":[{"color":"blue","label":"Beta version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\n# Request body type: publicCloud.database.QueryCancelRequest\nresult = client.post(\"/v2/publicCloud/project/{projectId}/managedDatabase/mysql/{serviceId}/currentQueries/{queryPid}/cancel\",\n\tterminate = None, # Whether to forcefully terminate the query instead of gracefully canceling it (type: boolean, nullable)\n)\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n// Request body type: publicCloud.database.QueryCancelRequest\n$result = $ovh->post(\"/v2/publicCloud/project/{projectId}/managedDatabase/mysql/{serviceId}/currentQueries/{queryPid}/cancel\", array(\n\tterminate => null, // Whether to forcefully terminate the query instead of gracefully canceling it (type: boolean, nullable)\n));\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:database/mysql/currentQueries/cancel","required":true}]}},"/publicCloud/project/{projectId}/managedDatabase/mysql/{serviceId}/queryStatistics":{"get":{"operationId":"getMysqlQueryStatistics","summary":"List query statistics","description":"Returns execution statistics for each query pattern: number of calls, rows and execution times.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"header","name":"X-Pagination-Cursor","description":"Pagination cursor","schema":{"type":"string"}},{"in":"header","name":"X-Pagination-Size","description":"Pagination size","schema":{"type":"integer"}},{"in":"query","name":"limit","description":"Maximum number of entries to return","schema":{"type":"integer"}},{"in":"query","name":"offset","description":"Number of entries to skip before returning results","schema":{"type":"integer"}},{"in":"path","name":"projectId","description":"Project ID","required":true,"schema":{"type":"string"}},{"in":"path","name":"serviceId","description":"Service ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/publicCloud.database.QueryStatistic"}}}}}},"tags":["Managed Databases","MySQL"],"x-developer-hub-navigation":[["Public Cloud","Databases","MySQL","Queries@@@40"]],"x-badges":[{"color":"blue","label":"Beta version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.get(\"/v2/publicCloud/project/{projectId}/managedDatabase/mysql/{serviceId}/queryStatistics\")\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->get(\"/v2/publicCloud/project/{projectId}/managedDatabase/mysql/{serviceId}/queryStatistics\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:database/mysql/queryStatistics/get","required":true}]}},"/publicCloud/project/{projectId}/managedDatabase/mysql/{serviceId}/queryStatistics/reset":{"post":{"operationId":"resetMysqlQueryStatistics","summary":"Reset query statistics","description":"Resets all aggregated query statistics of the service.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"projectId","description":"Project ID","required":true,"schema":{"type":"string"}},{"in":"path","name":"serviceId","description":"Service ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"successful operation"}},"tags":["Managed Databases","MySQL"],"x-developer-hub-navigation":[["Public Cloud","Databases","MySQL","Queries@@@50"]],"x-badges":[{"color":"blue","label":"Beta version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.post(\"/v2/publicCloud/project/{projectId}/managedDatabase/mysql/{serviceId}/queryStatistics/reset\")\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->post(\"/v2/publicCloud/project/{projectId}/managedDatabase/mysql/{serviceId}/queryStatistics/reset\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:database/mysql/queryStatistics/reset","required":true}]}}},"tags":[{"name":"Managed Databases","x-tag-expanded":false,"description":"Missing description"},{"name":"MySQL","x-tag-expanded":false,"description":"Missing description"}]}
