Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bot] APPS-9908 Add docs for exec endpoint: Re-Generated From digitalocean/openapi@b7a368d #382

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DO_OPENAPI_COMMIT_SHA.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ed79c72
b7a368d
241 changes: 241 additions & 0 deletions src/pydo/aio/operations/_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
build_apps_create_rollback_request,
build_apps_delete_request,
build_apps_get_deployment_request,
build_apps_get_exec_active_deployment_request,
build_apps_get_exec_request,
build_apps_get_instance_size_request,
build_apps_get_logs_active_deployment_aggregate_request,
build_apps_get_logs_active_deployment_request,
Expand Down Expand Up @@ -63551,6 +63553,124 @@ async def get_logs_active_deployment(

return cast(JSON, deserialized) # type: ignore

@distributed_trace_async
async def get_exec_active_deployment(
self, app_id: str, component_name: str, **kwargs: Any
) -> JSON:
# pylint: disable=line-too-long
"""Retrieve Exec URL.

Returns a websocket URL that allows sending/receiving console input and output to a component
of the active deployment if one exists.

:param app_id: The app ID. Required.
:type app_id: str
:param component_name: An optional component name. If set, logs will be limited to this
component only. Required.
:type component_name: str
:return: JSON object
:rtype: JSON
:raises ~azure.core.exceptions.HttpResponseError:

Example:
.. code-block:: python

# response body for status code(s): 200
response == {
"url": "str" # Optional. A websocket URL that allows sending/receiving
console input and receiving console output.
}
# response body for status code(s): 404
response == {
"id": "str", # A short identifier corresponding to the HTTP status code
returned. For example, the ID for a response returning a 404 status code would
be "not_found.". Required.
"message": "str", # A message providing additional information about the
error, including details to help resolve it when possible. Required.
"request_id": "str" # Optional. Optionally, some endpoints may include a
request ID that should be provided when reporting bugs or opening support
tickets to help identify the issue.
}
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
401: cast(
Type[HttpResponseError],
lambda response: ClientAuthenticationError(response=response),
),
429: HttpResponseError,
500: HttpResponseError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}

cls: ClsType[JSON] = kwargs.pop("cls", None)

_request = build_apps_get_exec_active_deployment_request(
app_id=app_id,
component_name=component_name,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)

_stream = False
pipeline_response: PipelineResponse = (
await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
)

response = pipeline_response.http_response

if response.status_code not in [200, 404]:
if _stream:
await response.read() # Load the body in memory and close the socket
map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore
raise HttpResponseError(response=response)

response_headers = {}
if response.status_code == 200:
response_headers["ratelimit-limit"] = self._deserialize(
"int", response.headers.get("ratelimit-limit")
)
response_headers["ratelimit-remaining"] = self._deserialize(
"int", response.headers.get("ratelimit-remaining")
)
response_headers["ratelimit-reset"] = self._deserialize(
"int", response.headers.get("ratelimit-reset")
)

if response.content:
deserialized = response.json()
else:
deserialized = None

if response.status_code == 404:
response_headers["ratelimit-limit"] = self._deserialize(
"int", response.headers.get("ratelimit-limit")
)
response_headers["ratelimit-remaining"] = self._deserialize(
"int", response.headers.get("ratelimit-remaining")
)
response_headers["ratelimit-reset"] = self._deserialize(
"int", response.headers.get("ratelimit-reset")
)

if response.content:
deserialized = response.json()
else:
deserialized = None

if cls:
return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore

return cast(JSON, deserialized) # type: ignore

@distributed_trace_async
async def list_deployments(
self, app_id: str, *, page: int = 1, per_page: int = 20, **kwargs: Any
Expand Down Expand Up @@ -72524,6 +72644,127 @@ async def get_logs_aggregate(

return cast(JSON, deserialized) # type: ignore

@distributed_trace_async
async def get_exec(
self, app_id: str, deployment_id: str, component_name: str, **kwargs: Any
) -> JSON:
# pylint: disable=line-too-long
"""Retrieve Exec URL for Deployment.

Returns a websocket URL that allows sending/receiving console input and output to a component
of the specified deployment if one exists.

:param app_id: The app ID. Required.
:type app_id: str
:param deployment_id: The deployment ID. Required.
:type deployment_id: str
:param component_name: An optional component name. If set, logs will be limited to this
component only. Required.
:type component_name: str
:return: JSON object
:rtype: JSON
:raises ~azure.core.exceptions.HttpResponseError:

Example:
.. code-block:: python

# response body for status code(s): 200
response == {
"url": "str" # Optional. A websocket URL that allows sending/receiving
console input and receiving console output.
}
# response body for status code(s): 404
response == {
"id": "str", # A short identifier corresponding to the HTTP status code
returned. For example, the ID for a response returning a 404 status code would
be "not_found.". Required.
"message": "str", # A message providing additional information about the
error, including details to help resolve it when possible. Required.
"request_id": "str" # Optional. Optionally, some endpoints may include a
request ID that should be provided when reporting bugs or opening support
tickets to help identify the issue.
}
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
401: cast(
Type[HttpResponseError],
lambda response: ClientAuthenticationError(response=response),
),
429: HttpResponseError,
500: HttpResponseError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}

cls: ClsType[JSON] = kwargs.pop("cls", None)

_request = build_apps_get_exec_request(
app_id=app_id,
deployment_id=deployment_id,
component_name=component_name,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)

_stream = False
pipeline_response: PipelineResponse = (
await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
)

response = pipeline_response.http_response

if response.status_code not in [200, 404]:
if _stream:
await response.read() # Load the body in memory and close the socket
map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore
raise HttpResponseError(response=response)

response_headers = {}
if response.status_code == 200:
response_headers["ratelimit-limit"] = self._deserialize(
"int", response.headers.get("ratelimit-limit")
)
response_headers["ratelimit-remaining"] = self._deserialize(
"int", response.headers.get("ratelimit-remaining")
)
response_headers["ratelimit-reset"] = self._deserialize(
"int", response.headers.get("ratelimit-reset")
)

if response.content:
deserialized = response.json()
else:
deserialized = None

if response.status_code == 404:
response_headers["ratelimit-limit"] = self._deserialize(
"int", response.headers.get("ratelimit-limit")
)
response_headers["ratelimit-remaining"] = self._deserialize(
"int", response.headers.get("ratelimit-remaining")
)
response_headers["ratelimit-reset"] = self._deserialize(
"int", response.headers.get("ratelimit-reset")
)

if response.content:
deserialized = response.json()
else:
deserialized = None

if cls:
return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore

return cast(JSON, deserialized) # type: ignore

@distributed_trace_async
async def get_logs_active_deployment_aggregate(
self,
Expand Down
Loading
Loading