{"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.Role":{"type":"object","description":"A role that can be assigned to users on a managed database service","properties":{"checksum":{"type":"string","description":"Hash of the resource used for concurrency control","readOnly":true},"createdAt":{"type":"string","description":"Date at which the resource was created","format":"date-time","readOnly":true},"id":{"type":"string","description":"Unique identifier of the role","format":"uuid","readOnly":true},"name":{"type":"string","description":"Name of the role","readOnly":true},"updatedAt":{"type":"string","description":"Date of the last update to the resource","format":"date-time","readOnly":true}}},"publicCloud.database.UserReplace":{"type":"object","description":"Input parameters for replacing a user on a managed service whose users are assigned roles. Every field is required: the request describes the whole user.","properties":{"roles":{"type":"array","description":"List of roles to assign to the user. Available roles depend on the engine.","items":{"type":"string"}}},"required":["roles"]},"publicCloud.database.UserStatusEnum":{"type":"string","description":"Readiness status of a managed database user","enum":["CREATING","DELETING","ERROR","READY","UPDATING"]},"publicCloud.database.UserUpdate":{"type":"object","description":"Input parameters for updating a user on a managed service whose users are assigned roles","properties":{"credentialsLastUpdatedAt":{"type":"string","description":"Date at which the user credentials were last updated. Setting this field triggers a credential reset and returns the new password.","format":"date-time"},"roles":{"type":"array","description":"List of roles to assign to the user. Available roles depend on the engine.","nullable":true,"items":{"type":"string"}}}},"publicCloud.database.UserWithRoles":{"type":"object","description":"A user account on a managed service whose users are assigned roles","properties":{"admin":{"type":"boolean","description":"Whether this is the service administrator, the user created automatically at provisioning time, which cannot be deleted","readOnly":true},"checksum":{"type":"string","description":"Hash of the resource used for concurrency control","readOnly":true},"createdAt":{"type":"string","description":"Date at which the user was created","format":"date-time","readOnly":true},"credentialsLastUpdatedAt":{"type":"string","description":"Date at which the user credentials were last updated","format":"date-time","readOnly":true},"id":{"type":"string","description":"Unique identifier of the user","format":"uuid","readOnly":true},"password":{"type":"string","description":"Password of the user. Returned only on creation or password reset.","nullable":true,"format":"password","readOnly":true},"roles":{"type":"array","description":"List of roles assigned to the user. Available roles depend on the engine.","items":{"type":"string"},"readOnly":true},"status":{"allOf":[{"$ref":"#/components/schemas/publicCloud.database.UserStatusEnum"}],"description":"Current readiness status of the user","readOnly":true},"username":{"type":"string","description":"Login name of the user","readOnly":true}}},"publicCloud.database.UserWithRolesCreation":{"type":"object","description":"Input parameters for creating a user on a managed service whose users are assigned roles","properties":{"name":{"type":"string","description":"Login name of the new user"},"roles":{"type":"array","description":"List of roles to assign to the user. Available roles depend on the engine.","nullable":true,"items":{"type":"string"}}},"required":["name"]},"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/postgresql/{serviceId}/roles":{"get":{"operationId":"getAllPostgresqlRoles","summary":"List roles","description":"Returns the roles that can be assigned to users.","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.Role"}}}}}},"tags":["Managed Databases","PostgreSQL"],"x-developer-hub-navigation":[["Public Cloud","Databases","PostgreSQL","Users@@@60"]],"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/postgresql/{serviceId}/roles\")\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/postgresql/{serviceId}/roles\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:database/postgresql/roles/get","required":true}],"x-response-identifier":"id","x-expanded-response":"PublicCloudDatabaseRole"}},"/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/roles/{roleId}":{"get":{"operationId":"getPostgresqlRole","summary":"Get a role","description":"Returns a role that can be assigned to users.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"projectId","description":"Project ID","required":true,"schema":{"type":"string"}},{"in":"path","name":"roleId","description":"Role ID","required":true,"schema":{"type":"string","format":"uuid"}},{"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.Role"}}}}},"tags":["Managed Databases","PostgreSQL"],"x-developer-hub-navigation":[["Public Cloud","Databases","PostgreSQL","Users@@@70"]],"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/postgresql/{serviceId}/roles/{roleId}\")\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/postgresql/{serviceId}/roles/{roleId}\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:database/postgresql/roles/get","required":true}],"x-response-identifier":"id"}},"/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/user":{"get":{"operationId":"getAllPostgresqlUsers","summary":"List users","description":"Returns the users of the service with their roles and status. Passwords are not returned.","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.UserWithRoles"}}}}}},"tags":["Managed Databases","PostgreSQL"],"x-developer-hub-navigation":[["Public Cloud","Databases","PostgreSQL","Users@@@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/postgresql/{serviceId}/user\")\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/postgresql/{serviceId}/user\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:database/postgresql/user/get","required":true}],"x-response-identifier":"id","x-expanded-response":"PublicCloudDatabaseUserWithRoles"},"post":{"operationId":"createPostgresqlUser","summary":"Create a user","description":"Creates a user with the given roles and generates its password. The password is returned only on creation and on password reset.","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"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.database.UserWithRolesCreation"}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.database.UserWithRoles"}}}}},"tags":["Managed Databases","PostgreSQL"],"x-developer-hub-navigation":[["Public Cloud","Databases","PostgreSQL","Users@@@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.UserWithRolesCreation\nresult = client.post(\"/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/user\",\n\tname = None, # Login name of the new user (type: string)\n\troles = None, # List of roles to assign to the user. Available roles depend on the engine. (type: array, 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.UserWithRolesCreation\n$result = $ovh->post(\"/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/user\", array(\n\tname => null, // Login name of the new user (type: string)\n\troles => null, // List of roles to assign to the user. Available roles depend on the engine. (type: array, nullable)\n));\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:database/postgresql/user/create","required":true}]}},"/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/user/{userId}":{"delete":{"operationId":"deletePostgresqlUser","summary":"Delete a user","description":"Permanently deletes the user.","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"}},{"in":"path","name":"userId","description":"User ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.database.UserWithRoles"}}}}},"tags":["Managed Databases","PostgreSQL"],"x-developer-hub-navigation":[["Public Cloud","Databases","PostgreSQL","Users@@@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.delete(\"/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/user/{userId}\")\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->delete(\"/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/user/{userId}\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:database/postgresql/user/delete","required":true}]},"get":{"operationId":"getPostgresqlUser","summary":"Get a user","description":"Returns the user, its roles and its status. The password is not returned.","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"}},{"in":"path","name":"userId","description":"User ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.database.UserWithRoles"}}}}},"tags":["Managed Databases","PostgreSQL"],"x-developer-hub-navigation":[["Public Cloud","Databases","PostgreSQL","Users@@@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/postgresql/{serviceId}/user/{userId}\")\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/postgresql/{serviceId}/user/{userId}\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:database/postgresql/user/get","required":true}],"x-response-identifier":"id"},"patch":{"operationId":"updatePostgresqlUser","summary":"Partially update a user","description":"Partially updates the roles of the user. The roles list replaces the current roles. Setting credentialsLastUpdatedAt resets the password and returns the new one.","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"}},{"in":"path","name":"userId","description":"User ID","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.database.UserUpdate"}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.database.UserWithRoles"}}}}},"tags":["Managed Databases","PostgreSQL"],"x-developer-hub-navigation":[["Public Cloud","Databases","PostgreSQL","Users@@@55"]],"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.UserUpdate\nresult = client.patch(\"/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/user/{userId}\",\n\tcredentialsLastUpdatedAt = None, # Date at which the user credentials were last updated. Setting this field triggers a credential reset and returns the new password. (type: string)\n\troles = None, # List of roles to assign to the user. Available roles depend on the engine. (type: array, 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.UserUpdate\n$result = $ovh->patch(\"/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/user/{userId}\", array(\n\tcredentialsLastUpdatedAt => null, // Date at which the user credentials were last updated. Setting this field triggers a credential reset and returns the new password. (type: string)\n\troles => null, // List of roles to assign to the user. Available roles depend on the engine. (type: array, nullable)\n));\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:database/postgresql/user/edit","required":true}]},"put":{"operationId":"editPostgresqlUser","summary":"Update a user","description":"Updates the roles of the user. The roles list replaces the current roles. To reset the password, use the resetPassword route of the user or a partial update with credentialsLastUpdatedAt.","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"}},{"in":"path","name":"userId","description":"User ID","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.database.UserReplace"}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.database.UserWithRoles"}}}}},"tags":["Managed Databases","PostgreSQL"],"x-developer-hub-navigation":[["Public Cloud","Databases","PostgreSQL","Users@@@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\n# Request body type: publicCloud.database.UserReplace\nresult = client.put(\"/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/user/{userId}\",\n\troles = None, # List of roles to assign to the user. Available roles depend on the engine. (type: array)\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.UserReplace\n$result = $ovh->put(\"/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/user/{userId}\", array(\n\troles => null, // List of roles to assign to the user. Available roles depend on the engine. (type: array)\n));\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:database/postgresql/user/edit","required":true}]}},"/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/user/{userId}/resetPassword":{"post":{"operationId":"resetPostgresqlUserPassword","summary":"Reset the password of a user","description":"Generates a new password for the user and returns it in the response. Reading the user never returns it. The previous password stops working once the new one is applied, and credentialsLastUpdatedAt becomes the date of this reset. This is the same reset as a partial update of the user that sets credentialsLastUpdatedAt.","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"}},{"in":"path","name":"userId","description":"User ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.database.UserWithRoles"}}}}},"tags":["Managed Databases","PostgreSQL"],"x-developer-hub-navigation":[["Public Cloud","Databases","PostgreSQL","Users@@@60"]],"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/postgresql/{serviceId}/user/{userId}/resetPassword\")\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/postgresql/{serviceId}/user/{userId}/resetPassword\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:database/postgresql/user/credentials/reset","required":true}]}}},"tags":[{"name":"Managed Databases","x-tag-expanded":false,"description":"Missing description"},{"name":"PostgreSQL","x-tag-expanded":false,"description":"Missing description"}]}
