### Python SDK Example Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/UpdateCluster.md Example demonstrating how to use the UpdateCluster model in the Python SDK, including instantiation from JSON, conversion to dictionary, and vice versa. ```python from timeweb_cloud_api.models.update_cluster import UpdateCluster # Example JSON string (replace with actual data) json_data = "{}" # Create an instance of UpdateCluster from a JSON string update_cluster_instance = UpdateCluster.from_json(json_data) # Print the JSON string representation of the object print(UpdateCluster.to_json()) # Convert the object into a dict update_cluster_dict = update_cluster_instance.to_dict() # Create an instance of UpdateCluster from a dict update_cluster_from_dict = UpdateCluster.from_dict(update_cluster_dict) ``` -------------------------------- ### Clone Server using Bearer Authentication Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServersApi.md This example demonstrates how to clone an existing server using Bearer token authentication. Ensure your BEARER_TOKEN is available in the environment. The server_id parameter is required to identify the server to be cloned. ```python import time import os import timeweb_cloud_api from timeweb_cloud_api.models.create_server201_response import CreateServer201Response from timeweb_cloud_api.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.timeweb.cloud # See configuration.py for a list of all supported configuration parameters. configuration = timeweb_cloud_api.Configuration( host = "https://api.timeweb.cloud" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure Bearer authorization (JWT): Bearer configuration = timeweb_cloud_api.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with timeweb_cloud_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = timeweb_cloud_api.ServersApi(api_client) server_id = 1051 # object | ID облачного сервера. try: # Клонирование сервера api_response = api_instance.clone_server(server_id) print("The response of ServersApi->clone_server:\n") pprint(api_response) except Exception as e: print("Exception when calling ServersApi->clone_server: %s\n" % e) ``` -------------------------------- ### GetKeys200Response Model Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/GetKeys200Response.md This snippet shows the structure of the GetKeys200Response model, including its properties 'meta' and 'ssh_keys'. It also provides example usage for creating an instance from a JSON string and converting it to a dictionary. ```APIDOC ## GetKeys200Response ### Description Represents the response object for the GetKeys operation, containing metadata and a collection of SSH keys. ### Properties - **meta** ([Meta](Meta.md)): An object containing metadata about the response. - **ssh_keys** (object): An object containing the SSH keys. ### Example Usage ```python from timeweb_cloud_api.models.get_keys200_response import GetKeys200Response # Example of creating an instance from a JSON string json_string = "{}" get_keys200_response_instance = GetKeys200Response.from_json(json_string) # Example of converting the object to a dictionary get_keys200_response_dict = get_keys200_response_instance.to_dict() # Example of creating an instance from a dictionary get_keys200_response_from_dict = GetKeys200Response.from_dict(get_keys200_response_dict) ``` ``` -------------------------------- ### Knowledgebase Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/Knowledgebase.md Demonstrates how to create a Knowledgebase instance from a JSON string and convert it to a dictionary. Also shows how to convert a dictionary back to a Knowledgebase instance. ```python from timeweb_cloud_api.models.knowledgebase import Knowledgebase # TODO update the JSON string below json = "{}" # create an instance of Knowledgebase from a JSON string knowledgebase_instance = Knowledgebase.from_json(json) # print the JSON string representation of the object print Knowledgebase.to_json() # convert the object into a dict knowledgebase_dict = knowledgebase_instance.to_dict() # create an instance of Knowledgebase from a dict knowledgebase_form_dict = knowledgebase.from_dict(knowledgebase_dict) ``` -------------------------------- ### Instantiate AddBitbucket from JSON Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/AddBitbucket.md Demonstrates how to create an AddBitbucket object from a JSON string and convert it to a dictionary. Ensure the JSON string is correctly formatted. ```python from timeweb_cloud_api.models.add_bitbucket import AddBitbucket # TODO update the JSON string below json = "{}" # create an instance of AddBitbucket from a JSON string add_bitbucket_instance = AddBitbucket.from_json(json) # print the JSON string representation of the object print AddBitbucket.to_json() # convert the object into a dict add_bitbucket_dict = add_bitbucket_instance.to_dict() # create an instance of AddBitbucket from a dict add_bitbucket_form_dict = add_bitbucket.from_dict(add_bitbucket_dict) ``` -------------------------------- ### Instantiate and Use GetKeys200Response Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/GetKeys200Response.md Demonstrates how to create a GetKeys200Response object from a JSON string, convert it to a dictionary, and create it from a dictionary. Requires the GetKeys200Response model import. ```python from timeweb_cloud_api.models.get_keys200_response import GetKeys200Response # TODO update the JSON string below json = "{}" # create an instance of GetKeys200Response from a JSON string get_keys200_response_instance = GetKeys200Response.from_json(json) # print the JSON string representation of the object print GetKeys200Response.to_json() # convert the object into a dict get_keys200_response_dict = get_keys200_response_instance.to_dict() # create an instance of GetKeys200Response from a dict get_keys200_response_form_dict = get_keys200_response.from_dict(get_keys200_response_dict) ``` -------------------------------- ### Providers Model Instantiation and Conversion Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/Providers.md Demonstrates creating a Providers instance from a JSON string or a dictionary, and converting it back to JSON or a dictionary. Requires importing the Providers model. ```python from timeweb_cloud_api.models.providers import Providers # TODO update the JSON string below json = "{}" # create an instance of Providers from a JSON string providers_instance = Providers.from_json(json) # print the JSON string representation of the object print Providers.to_json() # convert the object into a dict providers_dict = providers_instance.to_dict() # create an instance of Providers from a dict providers_form_dict = providers.from_dict(providers_dict) ``` -------------------------------- ### ServicePriceConfiguration Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServicePriceConfiguration.md Demonstrates how to create a ServicePriceConfiguration instance from a JSON string, convert it to a dictionary, and create it from a dictionary. Requires importing the ServicePriceConfiguration model. ```python from timeweb_cloud_api.models.service_price_configuration import ServicePriceConfiguration # TODO update the JSON string below json = "{}" # create an instance of ServicePriceConfiguration from a JSON string service_price_configuration_instance = ServicePriceConfiguration.from_json(json) # print the JSON string representation of the object print ServicePriceConfiguration.to_json() # convert the object into a dict service_price_configuration_dict = service_price_configuration_instance.to_dict() # create an instance of ServicePriceConfiguration from a dict service_price_configuration_form_dict = service_price_configuration.from_dict(service_price_configuration_dict) ``` -------------------------------- ### Python SDK: UpdateAgentSettings from JSON and to Dictionary Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/UpdateAgentSettings.md Demonstrates creating an UpdateAgentSettings instance from a JSON string and converting it to a dictionary. Ensure the JSON string is valid and properly formatted. ```python from timeweb_cloud_api.models.update_agent_settings import UpdateAgentSettings # TODO update the JSON string below json = "{}" # create an instance of UpdateAgentSettings from a JSON string update_agent_settings_instance = UpdateAgentSettings.from_json(json) # print the JSON string representation of the object print UpdateAgentSettings.to_json() # convert the object into a dict update_agent_settings_dict = update_agent_settings_instance.to_dict() # create an instance of UpdateAgentSettings from a dict update_agent_settings_form_dict = update_agent_settings.from_dict(update_agent_settings_dict) ``` -------------------------------- ### TopLevelDomain Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/TopLevelDomain.md Demonstrates how to create a TopLevelDomain instance from a JSON string and convert it to a dictionary. Also shows how to create an instance from a dictionary. ```python from timeweb_cloud_api.models.top_level_domain import TopLevelDomain # TODO update the JSON string below json = "{}" # create an instance of TopLevelDomain from a JSON string top_level_domain_instance = TopLevelDomain.from_json(json) # print the JSON string representation of the object print TopLevelDomain.to_json() # convert the object into a dict top_level_domain_dict = top_level_domain_instance.to_dict() # create an instance of TopLevelDomain from a dict top_level_domain_form_dict = top_level_domain.from_dict(top_level_domain_dict) ``` -------------------------------- ### UpdateAdmin Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/UpdateAdmin.md Demonstrates how to create an UpdateAdmin instance from a JSON string, convert it to a dictionary, and create an instance from a dictionary. Ensure the JSON string is valid. ```python from timeweb_cloud_api.models.update_admin import UpdateAdmin # TODO update the JSON string below json = "{}" # create an instance of UpdateAdmin from a JSON string update_admin_instance = UpdateAdmin.from_json(json) # print the JSON string representation of the object print UpdateAdmin.to_json() # convert the object into a dict update_admin_dict = update_admin_instance.to_dict() # create an instance of UpdateAdmin from a dict update_admin_form_dict = update_admin.from_dict(update_admin_dict) ``` -------------------------------- ### UpdateAgent Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/UpdateAgent.md Demonstrates how to create an UpdateAgent instance from a JSON string, convert it to a dictionary, and create a new instance from a dictionary. Requires importing the UpdateAgent model. ```python from timeweb_cloud_api.models.update_agent import UpdateAgent # TODO update the JSON string below json = "{}" # create an instance of UpdateAgent from a JSON string update_agent_instance = UpdateAgent.from_json(json) # print the JSON string representation of the object print UpdateAgent.to_json() # convert the object into a dict update_agent_dict = update_agent_instance.to_dict() # create an instance of UpdateAgent from a dict update_agent_form_dict = update_agent.from_dict(update_agent_dict) ``` -------------------------------- ### TokenPackage Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/TokenPackage.md Demonstrates how to create and manipulate TokenPackage objects using the timeweb-cloud-api Python SDK. Includes instantiation from JSON and dictionaries, and conversion to dictionaries. ```python from timeweb_cloud_api.models.token_package import TokenPackage # TODO update the JSON string below json = "{}" # create an instance of TokenPackage from a JSON string token_package_instance = TokenPackage.from_json(json) # print the JSON string representation of the object print TokenPackage.to_json() # convert the object into a dict token_package_dict = token_package_instance.to_dict() # create an instance of TokenPackage from a dict token_package_form_dict = token_package.from_dict(token_package_dict) ``` -------------------------------- ### UpdateProject Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/UpdateProject.md Demonstrates how to create an UpdateProject instance from a JSON string, convert it to a JSON string, and convert it to a dictionary. Ensure the JSON string is correctly formatted. ```python from timeweb_cloud_api.models.update_project import UpdateProject # TODO update the JSON string below json = "{}" # create an instance of UpdateProject from a JSON string update_project_instance = UpdateProject.from_json(json) # print the JSON string representation of the object print UpdateProject.to_json() # convert the object into a dict update_project_dict = update_project_instance.to_dict() # create an instance of UpdateProject from a dict update_project_form_dict = update_project.from_dict(update_project_dict) ``` -------------------------------- ### Free Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/Free.md Demonstrates how to create and manipulate Free model instances using Python, including conversion to and from JSON and dictionaries. ```APIDOC ## Free Model ### Description Represents a free resource or operation, likely related to domain transfers. ### Properties - **money_source** (object) - Required - Type of the request being created. - **person_id** (object) - Optional - ID of the administrator the domain is registered to. - **auth_code** (object) - Required - Authorization code for domain transfer. ### Example Usage ```python from timeweb_cloud_api.models.free import Free # TODO update the JSON string below json_string = "{}" # create an instance of Free from a JSON string free_instance = Free.from_json(json_string) # print the JSON string representation of the object print(Free.to_json()) # convert the object into a dict free_dict = free_instance.to_dict() # create an instance of Free from a dict free_form_dict = Free.from_dict(free_dict) ``` ``` -------------------------------- ### Update Server Details Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServersApi.md Use this method to update the details of an existing server. Ensure you have the correct server ID and provide the necessary update data. ```python import timeweb_cloud_api from pprint import pprint # Enter a context with an instance of the API client with timeweb_cloud_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = timeweb_cloud_api.ServersApi(api_client) server_id = 1051 # object | ID облачного сервера. update_server = timeweb_cloud_api.UpdateServer() # UpdateServer | try: # Изменение сервера api_response = api_instance.update_server(server_id, update_server) print("The response of ServersApi->update_server:\n") pprint(api_response) except Exception as e: print("Exception when calling ServersApi->update_server: %s\n" % e) ``` -------------------------------- ### ServicePrice Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServicePrice.md Demonstrates how to create a ServicePrice instance from a JSON string, convert it to a dictionary, and create an instance from a dictionary using the timeweb-cloud-api SDK. ```python from timeweb_cloud_api.models.service_price import ServicePrice # TODO update the JSON string below json = "{}" # create an instance of ServicePrice from a JSON string service_price_instance = ServicePrice.from_json(json) # print the JSON string representation of the object print ServicePrice.to_json() # convert the object into a dict service_price_dict = service_price_instance.to_dict() # create an instance of ServicePrice from a dict service_price_form_dict = service_price.from_dict(service_price_dict) ``` -------------------------------- ### UpdateCluster Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/UpdateCluster.md Demonstrates how to instantiate the UpdateCluster model from a JSON string, convert it to a dictionary, and create it from a dictionary. Ensure the JSON string is valid and contains the correct structure for UpdateCluster. ```python from timeweb_cloud_api.models.update_cluster import UpdateCluster # TODO update the JSON string below json = "{}" # create an instance of UpdateCluster from a JSON string update_cluster_instance = UpdateCluster.from_json(json) # print the JSON string representation of the object print UpdateCluster.to_json() # convert the object into a dict update_cluster_dict = update_cluster_instance.to_dict() # create an instance of UpdateCluster from a dict update_cluster_form_dict = update_cluster.from_dict(update_cluster_dict) ``` -------------------------------- ### UpdateDb Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/UpdateDb.md Demonstrates how to create an instance of UpdateDb from a JSON string, convert it to a dictionary, and create an instance from a dictionary. Ensure the JSON string is valid. ```python from timeweb_cloud_api.models.update_db import UpdateDb # TODO update the JSON string below json = "{}" # create an instance of UpdateDb from a JSON string update_db_instance = UpdateDb.from_json(json) # print the JSON string representation of the object print UpdateDb.to_json() # convert the object into a dict update_db_dict = update_db_instance.to_dict() # create an instance of UpdateDb from a dict update_db_form_dict = update_db.from_dict(update_db_dict) ``` -------------------------------- ### FirewallRuleDirection Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/FirewallRuleDirection.md Demonstrates how to create an instance of FirewallRuleDirection from a JSON string and a dictionary, and how to convert the object to its JSON string and dictionary representations. Ensure the JSON string is valid before parsing. ```python from timeweb_cloud_api.models.firewall_rule_direction import FirewallRuleDirection # TODO update the JSON string below json = "{}" # create an instance of FirewallRuleDirection from a JSON string firewall_rule_direction_instance = FirewallRuleDirection.from_json(json) # print the JSON string representation of the object print FirewallRuleDirection.to_json() # convert the object into a dict firewall_rule_direction_dict = firewall_rule_direction_instance.to_dict() # create an instance of FirewallRuleDirection from a dict firewall_rule_direction_form_dict = firewall_rule_direction.from_dict(firewall_rule_direction_dict) ``` -------------------------------- ### update_server_os_boot_mode Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServersApi.md Selects the operating system boot type for the server. ```APIDOC ## POST /api/v1/servers/{server_id}/boot-mode ### Description Выбор типа загрузки операционной системы сервера ### Method POST ### Endpoint /api/v1/servers/{server_id}/boot-mode ``` -------------------------------- ### DnsRecordV2Data Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/DnsRecordV2Data.md Demonstrates how to create an instance of DnsRecordV2Data from a JSON string and convert it to a dictionary. Ensure the JSON string is valid and properly formatted. ```python from timeweb_cloud_api.models.dns_record_v2_data import DnsRecordV2Data # TODO update the JSON string below json = "{}" # create an instance of DnsRecordV2Data from a JSON string dns_record_v2_data_instance = DnsRecordV2Data.from_json(json) # print the JSON string representation of the object print DnsRecordV2Data.to_json() # convert the object into a dict dns_record_v2_data_dict = dns_record_v2_data_instance.to_dict() # create an instance of DnsRecordV2Data from a dict dns_record_v2_data_form_dict = dns_record_v2_data.from_dict(dns_record_v2_data_dict) ``` -------------------------------- ### UpdateAgentSettings Model Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/UpdateAgentSettings.md This snippet shows how to use the UpdateAgentSettings model from the Python SDK, including instantiation from JSON, conversion to dictionary, and vice-versa. ```APIDOC ## UpdateAgentSettings ### Description Allows updating various settings for an agent. ### Properties - **model** (AgentModelSettings) - Optional - Settings related to the agent's model. - **system_prompt** (object) - Optional - The system prompt for the agent. - **refine_query** (object) - Optional - Determines if the query should be refined before processing. - **widget** (AgentSettingsWidget) - Optional - Widget specific settings for the agent. ### Request Example ```python from timeweb_cloud_api.models.update_agent_settings import UpdateAgentSettings # TODO update the JSON string below json_string = "{}" # create an instance of UpdateAgentSettings from a JSON string update_agent_settings_instance = UpdateAgentSettings.from_json(json_string) # convert the object into a dict update_agent_settings_dict = update_agent_settings_instance.to_dict() # create an instance of UpdateAgentSettings from a dict update_agent_settings_form_dict = UpdateAgentSettings.from_dict(update_agent_settings_dict) # print the JSON string representation of the object print(UpdateAgentSettings.to_json()) ``` ``` -------------------------------- ### TokenStatistic Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/TokenStatistic.md Demonstrates how to create a TokenStatistic instance from a JSON string, convert it to a dictionary, and create it from a dictionary. Ensure the JSON string is valid. ```python from timeweb_cloud_api.models.token_statistic import TokenStatistic # TODO update the JSON string below json = "{}" # create an instance of TokenStatistic from a JSON string token_statistic_instance = TokenStatistic.from_json(json) # print the JSON string representation of the object print TokenStatistic.to_json() # convert the object into a dict token_statistic_dict = token_statistic_instance.to_dict() # create an instance of TokenStatistic from a dict token_statistic_form_dict = token_statistic.from_dict(token_statistic_dict) ``` -------------------------------- ### TransferStatus Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/TransferStatus.md Demonstrates how to create a TransferStatus instance from a JSON string and convert it to a dictionary, and vice versa. Requires importing the TransferStatus model. ```python from timeweb_cloud_api.models.transfer_status import TransferStatus # TODO update the JSON string below json = "{}" # create an instance of TransferStatus from a JSON string transfer_status_instance = TransferStatus.from_json(json) # print the JSON string representation of the object print TransferStatus.to_json() # convert the object into a dict transfer_status_dict = transfer_status_instance.to_dict() # create an instance of TransferStatus from a dict transfer_status_form_dict = transfer_status.from_dict(transfer_status_dict) ``` -------------------------------- ### BaseError Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/BaseError.md Demonstrates how to instantiate and use the BaseError model, including conversion to and from JSON and dictionaries. ```APIDOC ## BaseError Model ### Description Represents a base error structure with details like status code, error code, message, and an optional response ID. ### Properties - **status_code** (object) - The HTTP status code associated with the error. - **error_code** (object) - A specific code identifying the type of error. - **message** (object) - A human-readable description of the error. - **response_id** (object) - An optional unique identifier for the response, useful for tracing. ### Example Usage ```python from timeweb_cloud_api.models.base_error import BaseError # TODO update the JSON string below json_string = "{}" # create an instance of BaseError from a JSON string base_error_instance = BaseError.from_json(json_string) # print the JSON string representation of the object print(BaseError.to_json()) # convert the object into a dict base_error_dict = base_error_instance.to_dict() # create an instance of BaseError from a dict base_error_from_dict = BaseError.from_dict(base_error_dict) ``` ``` -------------------------------- ### clone_server Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServersApi.md Clones an existing server. This operation creates a duplicate of a specified server. ```APIDOC ## POST /api/v1/servers/{server_id}/clone ### Description Clones a server. This operation sends a POST request to the specified server's clone endpoint. ### Method POST ### Endpoint /api/v1/servers/{server_id}/clone ### Parameters #### Path Parameters - **server_id** (object) - Required - ID of the cloud server. ### Response #### Success Response (201) - **CreateServer201Response** (object) - Description of the server creation response object. ### Authorization Bearer (JWT) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### update_server_disk_auto_backup_settings Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServersApi.md Updates the auto-backup settings for a server disk. ```APIDOC ## PATCH /api/v1/servers/{server_id}/disks/{disk_id}/auto-backups ### Description Изменение настроек автобэкапов диска сервера ### Method PATCH ### Endpoint /api/v1/servers/{server_id}/disks/{disk_id}/auto-backups ``` -------------------------------- ### BaseError Model Usage Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/BaseError.md Demonstrates how to create a BaseError instance from a JSON string, convert it to a dictionary, and create an instance from a dictionary. Requires importing the BaseError model. ```python from timeweb_cloud_api.models.base_error import BaseError # TODO update the JSON string below json = "{}" # create an instance of BaseError from a JSON string base_error_instance = BaseError.from_json(json) # print the JSON string representation of the object print BaseError.to_json() # convert the object into a dict base_error_dict = base_error_instance.to_dict() # create an instance of BaseError from a dict base_error_form_dict = base_error.from_dict(base_error_dict) ``` -------------------------------- ### Python Free Object Manipulation Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/Free.md Demonstrates how to create a Free object from a JSON string, convert it to JSON, convert it to a dictionary, and create a Free object from a dictionary. Ensure the JSON string is correctly formatted. ```python from timeweb_cloud_api.models.free import Free # TODO update the JSON string below json = "{}" # create an instance of Free from a JSON string free_instance = Free.from_json(json) # print the JSON string representation of the object print Free.to_json() # convert the object into a dict free_dict = free_instance.to_dict() # create an instance of Free from a dict free_form_dict = free.from_dict(free_dict) ``` -------------------------------- ### Add Server IP using Bearer Authentication Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServersApi.md Use this snippet to add an IP address to a server. Ensure you have your BEARER_TOKEN set in your environment variables. The AddServerIPRequest object can be populated with specific details if needed, but an empty object is used here for a basic request. ```python import time import os import timeweb_cloud_api from timeweb_cloud_api.models.add_server_ip201_response import AddServerIP201Response from timeweb_cloud_api.models.add_server_ip_request import AddServerIPRequest from timeweb_cloud_api.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.timeweb.cloud # See configuration.py for a list of all supported configuration parameters. configuration = timeweb_cloud_api.Configuration( host = "https://api.timeweb.cloud" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure Bearer authorization (JWT): Bearer configuration = timeweb_cloud_api.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with timeweb_cloud_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = timeweb_cloud_api.ServersApi(api_client) server_id = 1051 # object | ID облачного сервера. add_server_ip_request = timeweb_cloud_api.AddServerIPRequest() # AddServerIPRequest | try: # Добавление IP-адреса сервера api_response = api_instance.add_server_ip(server_id, add_server_ip_request) print("The response of ServersApi->add_server_ip:\n") pprint(api_response) except Exception as e: print("Exception when calling ServersApi->add_server_ip: %s\n" % e) ``` -------------------------------- ### update_server_disk_backup Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServersApi.md Updates a server disk backup. ```APIDOC ## PATCH /api/v1/servers/{server_id}/disks/{disk_id}/backups/{backup_id} ### Description Изменение бэкапа диска сервера ### Method PATCH ### Endpoint /api/v1/servers/{server_id}/disks/{disk_id}/backups/{backup_id} ``` -------------------------------- ### Update Server Disk Parameters Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServersApi.md Modify the parameters of a server's disk using this method. You need to provide both the server ID and the disk ID. The update request is optional. ```python import time import os import timeweb_cloud_api from timeweb_cloud_api.models.create_server_disk201_response import CreateServerDisk201Response from timeweb_cloud_api.models.update_server_disk_request import UpdateServerDiskRequest from timeweb_cloud_api.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.timeweb.cloud # See configuration.py for a list of all supported configuration parameters. configuration = timeweb_cloud_api.Configuration( host = "https://api.timeweb.cloud" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure Bearer authorization (JWT): Bearer configuration = timeweb_cloud_api.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with timeweb_cloud_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = timeweb_cloud_api.ServersApi(api_client) server_id = 1051 # object | ID облачного сервера. disk_id = 1051 # object | ID диска сервера. update_server_disk_request = timeweb_cloud_api.UpdateServerDiskRequest() # UpdateServerDiskRequest | (optional) try: # Изменение параметров диска сервера api_response = api_instance.update_server_disk(server_id, disk_id, update_server_disk_request=update_server_disk_request) print("The response of ServersApi->update_server_disk:\n") pprint(api_response) except Exception as e: print("Exception when calling ServersApi->update_server_disk: %s\n" % e) ``` -------------------------------- ### UpdateAgent Model Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/UpdateAgent.md This snippet shows how to use the UpdateAgent model from the timeweb-cloud-python SDK to create, serialize, and deserialize agent update data. ```APIDOC ## UpdateAgent Model This model represents the data structure used to update an AI agent. ### Properties - **name** (object) - Optional - The new name for the agent. - **description** (object) - Optional - The new description for the agent. - **access_type** (object) - Optional - The new access type for the agent. - **status** (object) - Optional - The new status for the agent. - **token_package_id** (object) - Optional - The ID of the token package to associate with the agent. - **settings** (UpdateAgentSettings) - Optional - An object containing updated settings for the agent. See [UpdateAgentSettings](UpdateAgentSettings.md) for details. - **project_id** (object) - Optional - The ID of the project the agent belongs to. ### Example Usage (Python SDK) ```python from timeweb_cloud_api.models.update_agent import UpdateAgent # Example of creating an UpdateAgent instance from a JSON string (replace with actual JSON) json_data = "{}" update_agent_instance = UpdateAgent.from_json(json_data) # Example of converting the object to a dictionary update_agent_dict = update_agent_instance.to_dict() # Example of creating an UpdateAgent instance from a dictionary update_agent_from_dict = UpdateAgent.from_dict(update_agent_dict) # Example of converting the object to a JSON string print(UpdateAgent.to_json()) ``` ``` -------------------------------- ### update_server_disk Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServersApi.md Updates the parameters of a server disk. ```APIDOC ## PATCH /api/v1/servers/{server_id}/disks/{disk_id} ### Description Изменение параметров диска сервера ### Method PATCH ### Endpoint /api/v1/servers/{server_id}/disks/{disk_id} ``` -------------------------------- ### Update Server Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServersApi.md Allows modification of a cloud server's properties. Requires the server ID and an UpdateServer object containing the desired changes. ```APIDOC ## UPDATE SERVER ### Description Allows modification of a cloud server's properties. Requires the server ID and an UpdateServer object containing the desired changes. ### Method POST ### Endpoint /api/v1/servers/{server_id} ### Parameters #### Path Parameters - **server_id** (object) - Required - ID облачного сервера. #### Request Body - **update_server** (UpdateServer) - Required - Object containing server update details. ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **server** (object) - Description of the updated server object. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### add_server_ip Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServersApi.md Adds an IP address to a server. This operation is available for servers in the 'ru-1' location for IPv6. ```APIDOC ## POST /api/v1/servers/{server_id}/ips ### Description Adds an IP address to a server. Currently, IPv6 is only available for servers with the 'ru-1' location. ### Method POST ### Endpoint /api/v1/servers/{server_id}/ips ### Parameters #### Path Parameters - **server_id** (object) - Required - ID of the cloud server. #### Request Body - **add_server_ip_request** (AddServerIPRequest) - Required - ### Response #### Success Response (201) - **server_ip** (object) - Description of the server IP object. ### Authorization Bearer (JWT) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ``` -------------------------------- ### update_mailbox Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/MailApi.md Изменение почтового ящика. Отправьте PATCH-запрос на /api/v1/mail/domains/{domain}/mailboxes/{mailbox}. ```APIDOC ## PATCH /api/v1/mail/domains/{domain}/mailboxes/{mailbox} ### Description Изменение почтового ящика ### Method PATCH ### Endpoint /api/v1/mail/domains/{domain}/mailboxes/{mailbox} ### Parameters #### Path Parameters - **domain** (object) - Required - Полное имя домена - **mailbox** (object) - Required - ### Parameters #### Request Body - **update_mailbox** (UpdateMailbox) - Required - ### Response #### Success Response (201) - **CreateDomainMailbox201Response** (object) - Description #### Response Example { "example": "{\"create_domain_mailbox201_response\": {}}" } ``` -------------------------------- ### update_domain_mail_info Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/MailApi.md Изменение почтовой информации о домене. Отправьте PATCH-запрос на /api/v1/mail/domains/{domain}/info. ```APIDOC ## PATCH /api/v1/mail/domains/{domain}/info ### Description Изменение почтовой информации о домене ### Method PATCH ### Endpoint /api/v1/mail/domains/{domain}/info ### Parameters #### Path Parameters - **domain** (object) - Required - Полное имя домена #### Request Body - **update_domain_mail_info_request** (UpdateDomainMailInfoRequest) - Required - ### Response #### Success Response (200) - **domain_info** (object) - Description #### Response Example { "example": "{\"domain_info\": {}}" } ``` -------------------------------- ### Update Server Disk Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServersApi.md Modifies the parameters of a server's disk. This operation requires the server ID, disk ID, and an optional UpdateServerDiskRequest object. ```APIDOC ## UPDATE SERVER DISK ### Description Modifies the parameters of a server's disk. This operation requires the server ID, disk ID, and an optional UpdateServerDiskRequest object. ### Method PATCH ### Endpoint /api/v1/servers/{server_id}/disks/{disk_id} ### Parameters #### Path Parameters - **server_id** (object) - Required - ID облачного сервера. - **disk_id** (object) - Required - ID диска сервера. #### Request Body - **update_server_disk_request** (UpdateServerDiskRequest) - Optional - Object containing disk update details. ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **server_disk** (object) - Description of the updated server disk object. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### update_server_ip Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServersApi.md Updates a server's IP address. ```APIDOC ## PATCH /api/v1/servers/{server_id}/ips ### Description Изменение IP-адреса сервера ### Method PATCH ### Endpoint /api/v1/servers/{server_id}/ips ``` -------------------------------- ### update_server_nat Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/ServersApi.md Updates server traffic routing rules (NAT). ```APIDOC ## PATCH /api/v1/servers/{server_id}/local-networks/nat-mode ### Description Изменение правил маршрутизации трафика сервера (NAT) ### Method PATCH ### Endpoint /api/v1/servers/{server_id}/local-networks/nat-mode ``` -------------------------------- ### UpdateCluster Model Properties Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/UpdateCluster.md The UpdateCluster model allows for updating various properties of a database cluster. Properties include name, preset_id, description, and public network accessibility. All properties are optional. ```APIDOC ## UpdateCluster Model ### Description Represents the parameters for updating a database cluster. ### Properties - **name** (object) - Optional - The name of the database cluster. - **preset_id** (object) - Optional - The ID of the pricing plan. - **description** (object) - Optional - A description for the database cluster. - **is_enabled_public_network** (object) - Optional - Indicates whether public IP address is available. ``` -------------------------------- ### Update Mailbox Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/MailApi.md Use this snippet to modify an existing mailbox. It requires Bearer token authentication and is used for PATCH requests to the mailbox endpoint. ```python import time import os import timeweb_cloud_api from timeweb_cloud_api.models.create_domain_mailbox201_response import CreateDomainMailbox201Response from timeweb_cloud_api.models.update_mailbox import UpdateMailbox from timeweb_cloud_api.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.timeweb.cloud ``` -------------------------------- ### Update Domain Mail Info Source: https://github.com/timeweb-cloud/sdk-python/blob/main/docs/MailApi.md Use this snippet to update the mail information for a specific domain. It requires Bearer token authentication and sends a PATCH request to the API. ```python import time import os import timeweb_cloud_api from timeweb_cloud_api.models.get_domain_mail_info200_response import GetDomainMailInfo200Response from timeweb_cloud_api.models.update_domain_mail_info_request import UpdateDomainMailInfoRequest from timeweb_cloud_api.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.timeweb.cloud # See configuration.py for a list of all supported configuration parameters. configuration = timeweb_cloud_api.Configuration( host = "https://api.timeweb.cloud" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure Bearer authorization (JWT): Bearer configuration = timeweb_cloud_api.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with timeweb_cloud_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = timeweb_cloud_api.MailApi(api_client) domain = somedomain.ru # object | Полное имя домена update_domain_mail_info_request = timeweb_cloud_api.UpdateDomainMailInfoRequest() # UpdateDomainMailInfoRequest | try: # Изменение почтовой информации о домене api_response = api_instance.update_domain_mail_info(domain, update_domain_mail_info_request) print("The response of MailApi->update_domain_mail_info:\n") pprint(api_response) except Exception as e: print("Exception when calling MailApi->update_domain_mail_info: %s\n" % e) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.