{"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.instance.ConsoleOutput":{"type":"object","description":"Console log retrieved from an instance, capturing the boot and system console output as reported by the backend","properties":{"output":{"type":"string","description":"Captured console log of the instance as a single text blob, typically the most recent lines of console output","readOnly":true}}},"publicCloud.instance.RemoteConsole":{"type":"object","description":"A remote console session opened on an instance, returned when creating a console. It provides the connection URL together with the negotiated protocol and display type.","properties":{"protocol":{"allOf":[{"$ref":"#/components/schemas/publicCloud.instance.RemoteConsoleProtocolEnum"}],"description":"Protocol of the opened console session (see RemoteConsoleProtocolEnum: VNC, SPICE, SERIAL)","readOnly":true},"type":{"allOf":[{"$ref":"#/components/schemas/publicCloud.instance.RemoteConsoleTypeEnum"}],"description":"Display type of the opened console session (see RemoteConsoleTypeEnum: NOVNC, XVPVNC, SPICE_HTML5, SERIAL)","readOnly":true},"url":{"type":"string","description":"Connection URL. URL to connect to the remote console. It is short-lived and grants temporary access to the instance's console.","readOnly":true}}},"publicCloud.instance.RemoteConsoleProtocolEnum":{"type":"string","description":"Underlying protocol used to reach an instance's remote console. `VNC`: VNC remote framebuffer protocol, giving graphical access to the instance console. `SPICE`: SPICE remote display protocol, offering richer graphical console access. `SERIAL`: Serial console protocol, giving text-based access to the instance's serial port.","enum":["SERIAL","SPICE","VNC"]},"publicCloud.instance.RemoteConsoleRequest":{"type":"object","description":"Remote console request. Payload for opening a remote console session on an instance. The requested protocol and display type must be compatible with each other and supported by the instance.","properties":{"protocol":{"allOf":[{"$ref":"#/components/schemas/publicCloud.instance.RemoteConsoleProtocolEnum"}],"description":"Desired console protocol (see RemoteConsoleProtocolEnum: VNC, SPICE, SERIAL)"},"type":{"allOf":[{"$ref":"#/components/schemas/publicCloud.instance.RemoteConsoleTypeEnum"}],"description":"Desired console display type (see RemoteConsoleTypeEnum: NOVNC, XVPVNC, SPICE_HTML5, SERIAL). It must be consistent with the chosen protocol."}},"required":["protocol","type"]},"publicCloud.instance.RemoteConsoleTypeEnum":{"type":"string","description":"Concrete console client/endpoint type returned when requesting access to an instance's remote console, combining a display technology with its transport. `NOVNC`: Browser-based VNC client (noVNC) served over the VNC protocol. `XVPVNC`: Xen VNC Proxy (xvpvnc) console, accessed with a dedicated VNC client. `SPICE_HTML5`: Browser-based SPICE client (spice-html5) served over the SPICE protocol. `SERIAL`: Serial console exposed over a websocket connection.","enum":["NOVNC","SERIAL","SPICE_HTML5","XVPVNC"]},"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}/compute/instance/{instanceId}/console":{"post":{"operationId":"createInstanceConsole","summary":"Create a remote console","description":"### Create a remote console\n\nOpens a remote console session to the instance and returns the connection details (a `url` and, depending on the protocol, an access `token`) for a client to connect. This is a synchronous call — no desired-state reconciliation — and the returned URL is short-lived, so request a fresh console when it expires.\n\n### Protocol and type\nChoose the console via the request body:\n* `protocol` — the console transport, for example `VNC`, `SPICE`, `SERIAL`.\n* `type` — the concrete console kind for that protocol, for example `NOVNC` for `VNC`, `SERIAL` for `SERIAL`.\n\nThe instance must be in a state that supports a console, otherwise the request is rejected with `ResourceInInvalidState`.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"instanceId","description":"Instance ID","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"path","name":"projectId","description":"Project ID","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.instance.RemoteConsoleRequest"},"examples":{"Serial console":{"value":{"protocol":"SERIAL","type":"SERIAL"},"summary":"Create a serial console"},"VNC console":{"value":{"protocol":"VNC","type":"NOVNC"},"summary":"Create a noVNC remote console"}}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.instance.RemoteConsole"}}}},"404":{"description":"Error 404 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::NotFound::InstanceDoesNotExist":{"value":{"class":"Client::NotFound::InstanceDoesNotExist","message":"Instance not found"}}}}}},"409":{"description":"Error 409 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::Conflict::ResourceInInvalidState":{"value":{"class":"Client::Conflict::ResourceInInvalidState","message":"Resource cannot be modified in its current state"}}}}}}},"tags":["Compute"],"x-developer-hub-navigation":[["Public Cloud","Compute","Instances","Console@@@20"]],"x-badges":[{"color":"green","label":"Stable production 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.instance.RemoteConsoleRequest\nresult = client.post(\"/v2/publicCloud/project/{projectId}/compute/instance/{instanceId}/console\",\n\tprotocol = None, # Desired console protocol (see RemoteConsoleProtocolEnum: VNC, SPICE, SERIAL) (type: publicCloud.instance.RemoteConsoleProtocolEnum)\n\ttype = None, # Desired console display type (see RemoteConsoleTypeEnum: NOVNC, XVPVNC, SPICE_HTML5, SERIAL). It must be consistent with the chosen protocol. (type: publicCloud.instance.RemoteConsoleTypeEnum)\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.instance.RemoteConsoleRequest\n$result = $ovh->post(\"/v2/publicCloud/project/{projectId}/compute/instance/{instanceId}/console\", array(\n\tprotocol => null, // Desired console protocol (see RemoteConsoleProtocolEnum: VNC, SPICE, SERIAL) (type: publicCloud.instance.RemoteConsoleProtocolEnum)\n\ttype => null, // Desired console display type (see RemoteConsoleTypeEnum: NOVNC, XVPVNC, SPICE_HTML5, SERIAL). It must be consistent with the chosen protocol. (type: publicCloud.instance.RemoteConsoleTypeEnum)\n));\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:instance/createConsole","required":true}]}},"/publicCloud/project/{projectId}/compute/instance/{instanceId}/consoleOutput":{"get":{"operationId":"getInstanceConsoleOutput","summary":"Get console output","description":"### Get console output\n\nReturns the serial console output (boot / system log) of the instance as text. Useful for diagnosing boot problems without opening an interactive console session. This is a read-only, synchronous call.\n\nUse the optional `length` query parameter to retrieve only the last N lines (the tail) of the log. Omit it to return all available output.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"instanceId","description":"Instance ID","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"query","name":"length","description":"Number of lines to retrieve from the end of the console log. When omitted, returns all available output.","schema":{"type":"integer"}},{"in":"path","name":"projectId","description":"Project ID","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/publicCloud.instance.ConsoleOutput"}}}},"404":{"description":"Error 404 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::NotFound::InstanceDoesNotExist":{"value":{"class":"Client::NotFound::InstanceDoesNotExist","message":"Instance not found"}}}}}}},"tags":["Compute"],"x-developer-hub-navigation":[["Public Cloud","Compute","Instances","Console@@@10"]],"x-badges":[{"color":"green","label":"Stable production 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}/compute/instance/{instanceId}/consoleOutput\")\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}/compute/instance/{instanceId}/consoleOutput\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"publicCloudProject:apiovh:instance/getConsoleOutput","required":true}]}}},"tags":[{"name":"Compute","x-tag-expanded":false,"description":"Missing description"}]}
