diff --git a/codegen.sh b/codegen.sh index 6579f01..6ffa961 100755 --- a/codegen.sh +++ b/codegen.sh @@ -7,5 +7,5 @@ cd swagger-codegen ./run-in-docker.sh generate -i public.swagger.json \ -l python -o /gen/out -DpackageName=src.cudo_compute cd .. -cp -r swagger-codegen/out/* . +cp -r swagger-codegen/out/src src diff --git a/helpers/cudo_client.py b/helpers/cudo_client.py new file mode 100644 index 0000000..40d0a85 --- /dev/null +++ b/helpers/cudo_client.py @@ -0,0 +1,15 @@ +def get_client(): + configuration = client.Configuration() + key, err = config.get_api_key() + + if err != None: + return None, err + + configuration.api_key['Authorization'] = key + # configuration.debug = True + configuration.api_key_prefix['Authorization'] = 'Bearer' + configuration.host = "https://rest.compute.cudo.org" + + sclient = client.ApiClient(configuration) + vms_api_client = client.VirtualMachinesApi(sclient) + return vms_api_client, None \ No newline at end of file diff --git a/helpers/print_config.py b/helpers/print_config.py new file mode 100644 index 0000000..aaeeb05 --- /dev/null +++ b/helpers/print_config.py @@ -0,0 +1,3 @@ +from helpers import config + +print(config.get_api_key()) diff --git a/src/cudo_compute/__init__.py b/src/cudo_compute/__init__.py new file mode 100644 index 0000000..55fb986 --- /dev/null +++ b/src/cudo_compute/__init__.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +# import apis into sdk package +from src.cudo_compute.api.api_keys_api import APIKeysApi +from src.cudo_compute.api.disks_api import DisksApi +from src.cudo_compute.api.networks_api import NetworksApi +from src.cudo_compute.api.object_storage_api import ObjectStorageApi +from src.cudo_compute.api.permissions_api import PermissionsApi +from src.cudo_compute.api.projects_api import ProjectsApi +from src.cudo_compute.api.ssh_keys_api import SSHKeysApi +from src.cudo_compute.api.search_api import SearchApi +from src.cudo_compute.api.user_api import UserApi +from src.cudo_compute.api.virtual_machines_api import VirtualMachinesApi + +# import ApiClient +from src.cudo_compute.api_client import ApiClient +from src.cudo_compute.configuration import Configuration +# import models into sdk package +from src.cudo_compute.models.any import Any +from src.cudo_compute.models.api_key import ApiKey +from src.cudo_compute.models.attach_storage_disk_response import AttachStorageDiskResponse +from src.cudo_compute.models.body import Body +from src.cudo_compute.models.body1 import Body1 +from src.cudo_compute.models.body10 import Body10 +from src.cudo_compute.models.body11 import Body11 +from src.cudo_compute.models.body2 import Body2 +from src.cudo_compute.models.body3 import Body3 +from src.cudo_compute.models.body4 import Body4 +from src.cudo_compute.models.body5 import Body5 +from src.cudo_compute.models.body6 import Body6 +from src.cudo_compute.models.body7 import Body7 +from src.cudo_compute.models.body8 import Body8 +from src.cudo_compute.models.body9 import Body9 +from src.cudo_compute.models.connect_vm_response import ConnectVMResponse +from src.cudo_compute.models.count_vms_response import CountVMsResponse +from src.cudo_compute.models.cpu_model_category import CpuModelCategory +from src.cudo_compute.models.create_disk_snapshot_response import CreateDiskSnapshotResponse +from src.cudo_compute.models.create_network_response import CreateNetworkResponse +from src.cudo_compute.models.create_private_vm_image_response import CreatePrivateVMImageResponse +from src.cudo_compute.models.create_security_group_response import CreateSecurityGroupResponse +from src.cudo_compute.models.create_storage_disk_response import CreateStorageDiskResponse +from src.cudo_compute.models.create_vm_request_nic import CreateVMRequestNIC +from src.cudo_compute.models.create_vm_response import CreateVMResponse +from src.cudo_compute.models.data_center_category import DataCenterCategory +from src.cudo_compute.models.decimal import Decimal +from src.cudo_compute.models.delete_disk_snapshot_response import DeleteDiskSnapshotResponse +from src.cudo_compute.models.delete_network_response import DeleteNetworkResponse +from src.cudo_compute.models.delete_object_storage_key_response import DeleteObjectStorageKeyResponse +from src.cudo_compute.models.delete_object_storage_user_response import DeleteObjectStorageUserResponse +from src.cudo_compute.models.delete_private_vm_image_response import DeletePrivateVMImageResponse +from src.cudo_compute.models.delete_security_group_response import DeleteSecurityGroupResponse +from src.cudo_compute.models.delete_storage_disk_response import DeleteStorageDiskResponse +from src.cudo_compute.models.detach_storage_disk_response import DetachStorageDiskResponse +from src.cudo_compute.models.disk import Disk +from src.cudo_compute.models.disk_state import DiskState +from src.cudo_compute.models.disk_storage_class import DiskStorageClass +from src.cudo_compute.models.disk_storage_price_hr import DiskStoragePriceHr +from src.cudo_compute.models.disk_type import DiskType +from src.cudo_compute.models.generate_api_key_request import GenerateApiKeyRequest +from src.cudo_compute.models.get_disk_response import GetDiskResponse +from src.cudo_compute.models.get_network_response import GetNetworkResponse +from src.cudo_compute.models.get_object_storage_session_key_response import GetObjectStorageSessionKeyResponse +from src.cudo_compute.models.get_private_vm_image_response import GetPrivateVMImageResponse +from src.cudo_compute.models.get_security_group_response import GetSecurityGroupResponse +from src.cudo_compute.models.get_vm_response import GetVMResponse +from src.cudo_compute.models.gpu_model_category import GpuModelCategory +from src.cudo_compute.models.host_config_category import HostConfigCategory +from src.cudo_compute.models.identity_verification_session import IdentityVerificationSession +from src.cudo_compute.models.image import Image +from src.cudo_compute.models.list_api_keys_response import ListApiKeysResponse +from src.cudo_compute.models.list_disk_snapshots_response import ListDiskSnapshotsResponse +from src.cudo_compute.models.list_disks_response import ListDisksResponse +from src.cudo_compute.models.list_networks_response import ListNetworksResponse +from src.cudo_compute.models.list_object_storage_buckets_response import ListObjectStorageBucketsResponse +from src.cudo_compute.models.list_object_storage_keys_response import ListObjectStorageKeysResponse +from src.cudo_compute.models.list_object_storage_users_response import ListObjectStorageUsersResponse +from src.cudo_compute.models.list_private_vm_images_response import ListPrivateVMImagesResponse +from src.cudo_compute.models.list_private_vm_images_response_private_image import ListPrivateVMImagesResponsePrivateImage +from src.cudo_compute.models.list_project_ssh_keys_response import ListProjectSshKeysResponse +from src.cudo_compute.models.list_projects_response import ListProjectsResponse +from src.cudo_compute.models.list_public_vm_images_response import ListPublicVMImagesResponse +from src.cudo_compute.models.list_regions_response import ListRegionsResponse +from src.cudo_compute.models.list_security_groups_response import ListSecurityGroupsResponse +from src.cudo_compute.models.list_ssh_keys_response import ListSshKeysResponse +from src.cudo_compute.models.list_user_permissions_response import ListUserPermissionsResponse +from src.cudo_compute.models.list_vm_data_centers_response import ListVMDataCentersResponse +from src.cudo_compute.models.list_vm_disks_response import ListVMDisksResponse +from src.cudo_compute.models.list_vm_machine_types_request import ListVMMachineTypesRequest +from src.cudo_compute.models.list_vm_machine_types_response import ListVMMachineTypesResponse +from src.cudo_compute.models.list_vms_response import ListVMsResponse +from src.cudo_compute.models.monitor_vm_response import MonitorVMResponse +from src.cudo_compute.models.network import Network +from src.cudo_compute.models.network_price_hr import NetworkPriceHr +from src.cudo_compute.models.object_storage_bucket import ObjectStorageBucket +from src.cudo_compute.models.object_storage_key import ObjectStorageKey +from src.cudo_compute.models.object_storage_user import ObjectStorageUser +from src.cudo_compute.models.profile import Profile +from src.cudo_compute.models.project import Project +from src.cudo_compute.models.protocol import Protocol +from src.cudo_compute.models.reboot_vm_response import RebootVMResponse +from src.cudo_compute.models.region import Region +from src.cudo_compute.models.resize_vm_disk_response import ResizeVMDiskResponse +from src.cudo_compute.models.resize_vm_response import ResizeVMResponse +from src.cudo_compute.models.revert_disk_response import RevertDiskResponse +from src.cudo_compute.models.role import Role +from src.cudo_compute.models.rule import Rule +from src.cudo_compute.models.rule_type import RuleType +from src.cudo_compute.models.security_group import SecurityGroup +from src.cudo_compute.models.security_group1 import SecurityGroup1 +from src.cudo_compute.models.security_group_rule import SecurityGroupRule +from src.cudo_compute.models.snapshot import Snapshot +from src.cudo_compute.models.ssh_key import SshKey +from src.cudo_compute.models.ssh_key_source import SshKeySource +from src.cudo_compute.models.start_network_response import StartNetworkResponse +from src.cudo_compute.models.start_vm_response import StartVMResponse +from src.cudo_compute.models.status import Status +from src.cudo_compute.models.stop_network_response import StopNetworkResponse +from src.cudo_compute.models.stop_vm_response import StopVMResponse +from src.cudo_compute.models.terminate_vm_response import TerminateVMResponse +from src.cudo_compute.models.update_private_vm_image_response import UpdatePrivateVMImageResponse +from src.cudo_compute.models.update_security_group_response import UpdateSecurityGroupResponse +from src.cudo_compute.models.user_permission import UserPermission +from src.cudo_compute.models.v1_private_image import V1PrivateImage +from src.cudo_compute.models.vm import VM +from src.cudo_compute.models.vm_data_center import VMDataCenter +from src.cudo_compute.models.vm_data_center_storage_class import VMDataCenterStorageClass +from src.cudo_compute.models.vm_monitoring_item import VMMonitoringItem +from src.cudo_compute.models.vmnic import VMNIC +from src.cudo_compute.models.v_router_size import VRouterSize diff --git a/src/cudo_compute/api/__init__.py b/src/cudo_compute/api/__init__.py new file mode 100644 index 0000000..a400d6d --- /dev/null +++ b/src/cudo_compute/api/__init__.py @@ -0,0 +1,15 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from src.cudo_compute.api.api_keys_api import APIKeysApi +from src.cudo_compute.api.disks_api import DisksApi +from src.cudo_compute.api.networks_api import NetworksApi +from src.cudo_compute.api.object_storage_api import ObjectStorageApi +from src.cudo_compute.api.permissions_api import PermissionsApi +from src.cudo_compute.api.projects_api import ProjectsApi +from src.cudo_compute.api.ssh_keys_api import SSHKeysApi +from src.cudo_compute.api.search_api import SearchApi +from src.cudo_compute.api.user_api import UserApi +from src.cudo_compute.api.virtual_machines_api import VirtualMachinesApi diff --git a/src/cudo_compute/api/api_keys_api.py b/src/cudo_compute/api/api_keys_api.py new file mode 100644 index 0000000..2658738 --- /dev/null +++ b/src/cudo_compute/api/api_keys_api.py @@ -0,0 +1,331 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from src.cudo_compute.api_client import ApiClient + + +class APIKeysApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def delete_api_key(self, name, **kwargs): # noqa: E501 + """Delete # noqa: E501 + + Deletes an API key, revoking all access for requests that use the key. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_api_key(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_api_key_with_http_info(name, **kwargs) # noqa: E501 + else: + (data) = self.delete_api_key_with_http_info(name, **kwargs) # noqa: E501 + return data + + def delete_api_key_with_http_info(self, name, **kwargs): # noqa: E501 + """Delete # noqa: E501 + + Deletes an API key, revoking all access for requests that use the key. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_api_key_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str name: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_api_key" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and ('name' not in params or + params['name'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `name` when calling `delete_api_key`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/api-keys/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def generate_api_key(self, body, **kwargs): # noqa: E501 + """Generate # noqa: E501 + + Creates a new API key for the requesting user. The API key is returned in the response, and this is the only time it can be viewed. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.generate_api_key(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GenerateApiKeyRequest body: (required) + :return: ApiKey + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.generate_api_key_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.generate_api_key_with_http_info(body, **kwargs) # noqa: E501 + return data + + def generate_api_key_with_http_info(self, body, **kwargs): # noqa: E501 + """Generate # noqa: E501 + + Creates a new API key for the requesting user. The API key is returned in the response, and this is the only time it can be viewed. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.generate_api_key_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GenerateApiKeyRequest body: (required) + :return: ApiKey + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method generate_api_key" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `generate_api_key`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/api-keys', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiKey', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_api_keys(self, **kwargs): # noqa: E501 + """List # noqa: E501 + + List the details of all API keys created by the requesting user. This does not include the API key itself which is only visible once when the API key is created. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_api_keys(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int page_number: + :param int page_size: + :return: ListApiKeysResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_api_keys_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.list_api_keys_with_http_info(**kwargs) # noqa: E501 + return data + + def list_api_keys_with_http_info(self, **kwargs): # noqa: E501 + """List # noqa: E501 + + List the details of all API keys created by the requesting user. This does not include the API key itself which is only visible once when the API key is created. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_api_keys_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int page_number: + :param int page_size: + :return: ListApiKeysResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['page_number', 'page_size'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_api_keys" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'page_number' in params: + query_params.append(('pageNumber', params['page_number'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/api-keys', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListApiKeysResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/cudo_compute/api/disks_api.py b/src/cudo_compute/api/disks_api.py new file mode 100644 index 0000000..c005ddf --- /dev/null +++ b/src/cudo_compute/api/disks_api.py @@ -0,0 +1,1132 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from src.cudo_compute.api_client import ApiClient + + +class DisksApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def attach_storage_disk(self, project_id, id, **kwargs): # noqa: E501 + """Attach storage disk to VM # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.attach_storage_disk(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str vm_id: + :return: AttachStorageDiskResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.attach_storage_disk_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.attach_storage_disk_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def attach_storage_disk_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Attach storage disk to VM # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.attach_storage_disk_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str vm_id: + :return: AttachStorageDiskResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id', 'vm_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method attach_storage_disk" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `attach_storage_disk`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `attach_storage_disk`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'vm_id' in params: + query_params.append(('vmId', params['vm_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/disk/{id}/attach', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AttachStorageDiskResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_disk_snapshot(self, project_id, id, body, **kwargs): # noqa: E501 + """Create Disk Snapshot # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_disk_snapshot(project_id, id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param Body6 body: (required) + :return: CreateDiskSnapshotResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_disk_snapshot_with_http_info(project_id, id, body, **kwargs) # noqa: E501 + else: + (data) = self.create_disk_snapshot_with_http_info(project_id, id, body, **kwargs) # noqa: E501 + return data + + def create_disk_snapshot_with_http_info(self, project_id, id, body, **kwargs): # noqa: E501 + """Create Disk Snapshot # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_disk_snapshot_with_http_info(project_id, id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param Body6 body: (required) + :return: CreateDiskSnapshotResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_disk_snapshot" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `create_disk_snapshot`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `create_disk_snapshot`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `create_disk_snapshot`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/disks/{id}/snapshots', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CreateDiskSnapshotResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_storage_disk(self, project_id, body, **kwargs): # noqa: E501 + """Create storage disk # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_storage_disk(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Body5 body: (required) + :return: CreateStorageDiskResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_storage_disk_with_http_info(project_id, body, **kwargs) # noqa: E501 + else: + (data) = self.create_storage_disk_with_http_info(project_id, body, **kwargs) # noqa: E501 + return data + + def create_storage_disk_with_http_info(self, project_id, body, **kwargs): # noqa: E501 + """Create storage disk # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_storage_disk_with_http_info(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Body5 body: (required) + :return: CreateStorageDiskResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_storage_disk" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `create_storage_disk`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `create_storage_disk`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/disks', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CreateStorageDiskResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_disk_snapshot(self, project_id, id, snapshot_id, vm_id, **kwargs): # noqa: E501 + """Delete Disk Snapshots # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_disk_snapshot(project_id, id, snapshot_id, vm_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str snapshot_id: (required) + :param str vm_id: (required) + :return: DeleteDiskSnapshotResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_disk_snapshot_with_http_info(project_id, id, snapshot_id, vm_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_disk_snapshot_with_http_info(project_id, id, snapshot_id, vm_id, **kwargs) # noqa: E501 + return data + + def delete_disk_snapshot_with_http_info(self, project_id, id, snapshot_id, vm_id, **kwargs): # noqa: E501 + """Delete Disk Snapshots # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_disk_snapshot_with_http_info(project_id, id, snapshot_id, vm_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str snapshot_id: (required) + :param str vm_id: (required) + :return: DeleteDiskSnapshotResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id', 'snapshot_id', 'vm_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_disk_snapshot" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `delete_disk_snapshot`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `delete_disk_snapshot`") # noqa: E501 + # verify the required parameter 'snapshot_id' is set + if self.api_client.client_side_validation and ('snapshot_id' not in params or + params['snapshot_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `snapshot_id` when calling `delete_disk_snapshot`") # noqa: E501 + # verify the required parameter 'vm_id' is set + if self.api_client.client_side_validation and ('vm_id' not in params or + params['vm_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `vm_id` when calling `delete_disk_snapshot`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'snapshot_id' in params: + query_params.append(('snapshotId', params['snapshot_id'])) # noqa: E501 + if 'vm_id' in params: + query_params.append(('vmId', params['vm_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/disks/{id}/snapshots', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DeleteDiskSnapshotResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_storage_disk(self, project_id, id, **kwargs): # noqa: E501 + """Delete storage disk # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_storage_disk(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: DeleteStorageDiskResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_storage_disk_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.delete_storage_disk_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def delete_storage_disk_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Delete storage disk # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_storage_disk_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: DeleteStorageDiskResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_storage_disk" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `delete_storage_disk`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `delete_storage_disk`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/disks/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DeleteStorageDiskResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def detach_storage_disk(self, project_id, id, **kwargs): # noqa: E501 + """Detach storage disk from VM # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.detach_storage_disk(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: DetachStorageDiskResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.detach_storage_disk_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.detach_storage_disk_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def detach_storage_disk_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Detach storage disk from VM # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.detach_storage_disk_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: DetachStorageDiskResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method detach_storage_disk" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `detach_storage_disk`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `detach_storage_disk`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/disk/{id}/detach', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DetachStorageDiskResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_disk(self, project_id, id, **kwargs): # noqa: E501 + """List disks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_disk(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: GetDiskResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_disk_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.get_disk_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def get_disk_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """List disks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_disk_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: GetDiskResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_disk" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `get_disk`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_disk`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/disks/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GetDiskResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_disk_snapshots(self, project_id, id, **kwargs): # noqa: E501 + """List Disk Snapshots # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_disk_snapshots(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: ListDiskSnapshotsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_disk_snapshots_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.list_disk_snapshots_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def list_disk_snapshots_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """List Disk Snapshots # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_disk_snapshots_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: ListDiskSnapshotsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_disk_snapshots" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `list_disk_snapshots`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `list_disk_snapshots`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/disks/{id}/snapshots', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListDiskSnapshotsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_disks(self, project_id, **kwargs): # noqa: E501 + """List disks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_disks(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param int page_number: + :param int page_size: + :param str data_center_id: + :return: ListDisksResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_disks_with_http_info(project_id, **kwargs) # noqa: E501 + else: + (data) = self.list_disks_with_http_info(project_id, **kwargs) # noqa: E501 + return data + + def list_disks_with_http_info(self, project_id, **kwargs): # noqa: E501 + """List disks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_disks_with_http_info(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param int page_number: + :param int page_size: + :param str data_center_id: + :return: ListDisksResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'page_number', 'page_size', 'data_center_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_disks" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `list_disks`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + if 'page_number' in params: + query_params.append(('pageNumber', params['page_number'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + if 'data_center_id' in params: + query_params.append(('dataCenterId', params['data_center_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/disks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListDisksResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def revert_disk(self, project_id, id, snapshot_id, vm_id, **kwargs): # noqa: E501 + """Revert Disk to Snapshot # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.revert_disk(project_id, id, snapshot_id, vm_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str snapshot_id: (required) + :param str vm_id: (required) + :return: RevertDiskResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.revert_disk_with_http_info(project_id, id, snapshot_id, vm_id, **kwargs) # noqa: E501 + else: + (data) = self.revert_disk_with_http_info(project_id, id, snapshot_id, vm_id, **kwargs) # noqa: E501 + return data + + def revert_disk_with_http_info(self, project_id, id, snapshot_id, vm_id, **kwargs): # noqa: E501 + """Revert Disk to Snapshot # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.revert_disk_with_http_info(project_id, id, snapshot_id, vm_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str snapshot_id: (required) + :param str vm_id: (required) + :return: RevertDiskResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id', 'snapshot_id', 'vm_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method revert_disk" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `revert_disk`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `revert_disk`") # noqa: E501 + # verify the required parameter 'snapshot_id' is set + if self.api_client.client_side_validation and ('snapshot_id' not in params or + params['snapshot_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `snapshot_id` when calling `revert_disk`") # noqa: E501 + # verify the required parameter 'vm_id' is set + if self.api_client.client_side_validation and ('vm_id' not in params or + params['vm_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `vm_id` when calling `revert_disk`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'snapshot_id' in params: + query_params.append(('snapshotId', params['snapshot_id'])) # noqa: E501 + if 'vm_id' in params: + query_params.append(('vmId', params['vm_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/disks/{id}/revert', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='RevertDiskResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/cudo_compute/api/networks_api.py b/src/cudo_compute/api/networks_api.py new file mode 100644 index 0000000..fa7070d --- /dev/null +++ b/src/cudo_compute/api/networks_api.py @@ -0,0 +1,1225 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from src.cudo_compute.api_client import ApiClient + + +class NetworksApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_network(self, project_id, body, **kwargs): # noqa: E501 + """Create network # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_network(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Body7 body: (required) + :return: CreateNetworkResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_network_with_http_info(project_id, body, **kwargs) # noqa: E501 + else: + (data) = self.create_network_with_http_info(project_id, body, **kwargs) # noqa: E501 + return data + + def create_network_with_http_info(self, project_id, body, **kwargs): # noqa: E501 + """Create network # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_network_with_http_info(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Body7 body: (required) + :return: CreateNetworkResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_network" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `create_network`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `create_network`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/networks', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CreateNetworkResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_security_group(self, security_group_project_id, security_group, **kwargs): # noqa: E501 + """Create security group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_security_group(security_group_project_id, security_group, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str security_group_project_id: (required) + :param SecurityGroup security_group: (required) + :return: CreateSecurityGroupResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_security_group_with_http_info(security_group_project_id, security_group, **kwargs) # noqa: E501 + else: + (data) = self.create_security_group_with_http_info(security_group_project_id, security_group, **kwargs) # noqa: E501 + return data + + def create_security_group_with_http_info(self, security_group_project_id, security_group, **kwargs): # noqa: E501 + """Create security group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_security_group_with_http_info(security_group_project_id, security_group, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str security_group_project_id: (required) + :param SecurityGroup security_group: (required) + :return: CreateSecurityGroupResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['security_group_project_id', 'security_group'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_security_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'security_group_project_id' is set + if self.api_client.client_side_validation and ('security_group_project_id' not in params or + params['security_group_project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `security_group_project_id` when calling `create_security_group`") # noqa: E501 + # verify the required parameter 'security_group' is set + if self.api_client.client_side_validation and ('security_group' not in params or + params['security_group'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `security_group` when calling `create_security_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'security_group_project_id' in params: + path_params['securityGroup.projectId'] = params['security_group_project_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'security_group' in params: + body_params = params['security_group'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{securityGroup.projectId}/networks/security-groups', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CreateSecurityGroupResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_network(self, project_id, id, network_id, **kwargs): # noqa: E501 + """Delete network # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_network(project_id, id, network_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str network_id: (required) + :return: DeleteNetworkResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_network_with_http_info(project_id, id, network_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_network_with_http_info(project_id, id, network_id, **kwargs) # noqa: E501 + return data + + def delete_network_with_http_info(self, project_id, id, network_id, **kwargs): # noqa: E501 + """Delete network # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_network_with_http_info(project_id, id, network_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str network_id: (required) + :return: DeleteNetworkResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id', 'network_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_network" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `delete_network`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `delete_network`") # noqa: E501 + # verify the required parameter 'network_id' is set + if self.api_client.client_side_validation and ('network_id' not in params or + params['network_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `network_id` when calling `delete_network`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'network_id' in params: + query_params.append(('networkId', params['network_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/networks/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DeleteNetworkResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_security_group(self, project_id, id, **kwargs): # noqa: E501 + """Delete security group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_security_group(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: DeleteSecurityGroupResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_security_group_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.delete_security_group_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def delete_security_group_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Delete security group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_security_group_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: DeleteSecurityGroupResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_security_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `delete_security_group`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `delete_security_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/networks/security-groups/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DeleteSecurityGroupResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_network(self, project_id, id, **kwargs): # noqa: E501 + """Get network # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_network(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: GetNetworkResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_network_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.get_network_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def get_network_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Get network # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_network_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: GetNetworkResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_network" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `get_network`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_network`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/networks/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GetNetworkResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_security_group(self, project_id, id, **kwargs): # noqa: E501 + """Get a security group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_security_group(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: GetSecurityGroupResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_security_group_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.get_security_group_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def get_security_group_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Get a security group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_security_group_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: GetSecurityGroupResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_security_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `get_security_group`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_security_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/networks/security-groups/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GetSecurityGroupResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_networks(self, project_id, **kwargs): # noqa: E501 + """List networks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_networks(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param int page_number: + :param int page_size: + :return: ListNetworksResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_networks_with_http_info(project_id, **kwargs) # noqa: E501 + else: + (data) = self.list_networks_with_http_info(project_id, **kwargs) # noqa: E501 + return data + + def list_networks_with_http_info(self, project_id, **kwargs): # noqa: E501 + """List networks # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_networks_with_http_info(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param int page_number: + :param int page_size: + :return: ListNetworksResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'page_number', 'page_size'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_networks" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `list_networks`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + if 'page_number' in params: + query_params.append(('pageNumber', params['page_number'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/networks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListNetworksResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_security_groups(self, project_id, **kwargs): # noqa: E501 + """List security groups # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_security_groups(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str data_center_id: + :param int page_number: + :param int page_size: + :return: ListSecurityGroupsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_security_groups_with_http_info(project_id, **kwargs) # noqa: E501 + else: + (data) = self.list_security_groups_with_http_info(project_id, **kwargs) # noqa: E501 + return data + + def list_security_groups_with_http_info(self, project_id, **kwargs): # noqa: E501 + """List security groups # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_security_groups_with_http_info(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str data_center_id: + :param int page_number: + :param int page_size: + :return: ListSecurityGroupsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'data_center_id', 'page_number', 'page_size'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_security_groups" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `list_security_groups`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + if 'data_center_id' in params: + query_params.append(('dataCenterId', params['data_center_id'])) # noqa: E501 + if 'page_number' in params: + query_params.append(('pageNumber', params['page_number'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/networks/security-groups', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListSecurityGroupsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def start_network(self, project_id, id, network_id, **kwargs): # noqa: E501 + """Start network # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.start_network(project_id, id, network_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str network_id: (required) + :return: StartNetworkResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.start_network_with_http_info(project_id, id, network_id, **kwargs) # noqa: E501 + else: + (data) = self.start_network_with_http_info(project_id, id, network_id, **kwargs) # noqa: E501 + return data + + def start_network_with_http_info(self, project_id, id, network_id, **kwargs): # noqa: E501 + """Start network # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.start_network_with_http_info(project_id, id, network_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str network_id: (required) + :return: StartNetworkResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id', 'network_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method start_network" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `start_network`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `start_network`") # noqa: E501 + # verify the required parameter 'network_id' is set + if self.api_client.client_side_validation and ('network_id' not in params or + params['network_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `network_id` when calling `start_network`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'network_id' in params: + query_params.append(('networkId', params['network_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/networks/{id}/start', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='StartNetworkResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def stop_network(self, project_id, id, network_id, **kwargs): # noqa: E501 + """Stop network # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.stop_network(project_id, id, network_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str network_id: (required) + :return: StopNetworkResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.stop_network_with_http_info(project_id, id, network_id, **kwargs) # noqa: E501 + else: + (data) = self.stop_network_with_http_info(project_id, id, network_id, **kwargs) # noqa: E501 + return data + + def stop_network_with_http_info(self, project_id, id, network_id, **kwargs): # noqa: E501 + """Stop network # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.stop_network_with_http_info(project_id, id, network_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str network_id: (required) + :return: StopNetworkResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id', 'network_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method stop_network" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `stop_network`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `stop_network`") # noqa: E501 + # verify the required parameter 'network_id' is set + if self.api_client.client_side_validation and ('network_id' not in params or + params['network_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `network_id` when calling `stop_network`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'network_id' in params: + query_params.append(('networkId', params['network_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/networks/{id}/stop', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='StopNetworkResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_security_group(self, security_group_project_id, security_group_id, security_group, **kwargs): # noqa: E501 + """Update security group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_security_group(security_group_project_id, security_group_id, security_group, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str security_group_project_id: (required) + :param str security_group_id: (required) + :param SecurityGroup1 security_group: (required) + :return: UpdateSecurityGroupResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_security_group_with_http_info(security_group_project_id, security_group_id, security_group, **kwargs) # noqa: E501 + else: + (data) = self.update_security_group_with_http_info(security_group_project_id, security_group_id, security_group, **kwargs) # noqa: E501 + return data + + def update_security_group_with_http_info(self, security_group_project_id, security_group_id, security_group, **kwargs): # noqa: E501 + """Update security group # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_security_group_with_http_info(security_group_project_id, security_group_id, security_group, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str security_group_project_id: (required) + :param str security_group_id: (required) + :param SecurityGroup1 security_group: (required) + :return: UpdateSecurityGroupResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['security_group_project_id', 'security_group_id', 'security_group'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_security_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'security_group_project_id' is set + if self.api_client.client_side_validation and ('security_group_project_id' not in params or + params['security_group_project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `security_group_project_id` when calling `update_security_group`") # noqa: E501 + # verify the required parameter 'security_group_id' is set + if self.api_client.client_side_validation and ('security_group_id' not in params or + params['security_group_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `security_group_id` when calling `update_security_group`") # noqa: E501 + # verify the required parameter 'security_group' is set + if self.api_client.client_side_validation and ('security_group' not in params or + params['security_group'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `security_group` when calling `update_security_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'security_group_project_id' in params: + path_params['securityGroup.projectId'] = params['security_group_project_id'] # noqa: E501 + if 'security_group_id' in params: + path_params['securityGroup.id'] = params['security_group_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'security_group' in params: + body_params = params['security_group'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{securityGroup.projectId}/networks/security-groups/{securityGroup.id}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UpdateSecurityGroupResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/cudo_compute/api/object_storage_api.py b/src/cudo_compute/api/object_storage_api.py new file mode 100644 index 0000000..c4769ac --- /dev/null +++ b/src/cudo_compute/api/object_storage_api.py @@ -0,0 +1,1100 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from src.cudo_compute.api_client import ApiClient + + +class ObjectStorageApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def activate(self, project_id, body, **kwargs): # noqa: E501 + """Allow the use of S3 compatible storage in a project # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.activate(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Body8 body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.activate_with_http_info(project_id, body, **kwargs) # noqa: E501 + else: + (data) = self.activate_with_http_info(project_id, body, **kwargs) # noqa: E501 + return data + + def activate_with_http_info(self, project_id, body, **kwargs): # noqa: E501 + """Allow the use of S3 compatible storage in a project # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.activate_with_http_info(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Body8 body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method activate" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `activate`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `activate`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/object-storage/activate', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_object_storage_user(self, project_id, body, **kwargs): # noqa: E501 + """Create user that stores keys for storage buckets # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_object_storage_user(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Body9 body: (required) + :return: ObjectStorageUser + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_object_storage_user_with_http_info(project_id, body, **kwargs) # noqa: E501 + else: + (data) = self.create_object_storage_user_with_http_info(project_id, body, **kwargs) # noqa: E501 + return data + + def create_object_storage_user_with_http_info(self, project_id, body, **kwargs): # noqa: E501 + """Create user that stores keys for storage buckets # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_object_storage_user_with_http_info(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Body9 body: (required) + :return: ObjectStorageUser + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_object_storage_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `create_object_storage_user`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `create_object_storage_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/object-storage/users', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ObjectStorageUser', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_object_storage_key(self, project_id, id, **kwargs): # noqa: E501 + """Delete object storage user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_object_storage_key(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str access_key: + :return: DeleteObjectStorageKeyResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_object_storage_key_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.delete_object_storage_key_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def delete_object_storage_key_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Delete object storage user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_object_storage_key_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str access_key: + :return: DeleteObjectStorageKeyResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id', 'access_key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_object_storage_key" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `delete_object_storage_key`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `delete_object_storage_key`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'access_key' in params: + query_params.append(('accessKey', params['access_key'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/object-storage/users/{id}/keys', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DeleteObjectStorageKeyResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_object_storage_user(self, project_id, id, **kwargs): # noqa: E501 + """Delete object storage user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_object_storage_user(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: DeleteObjectStorageUserResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_object_storage_user_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.delete_object_storage_user_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def delete_object_storage_user_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Delete object storage user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_object_storage_user_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: DeleteObjectStorageUserResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_object_storage_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `delete_object_storage_user`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `delete_object_storage_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/object-storage/users/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DeleteObjectStorageUserResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def generate_object_storage_key(self, project_id, id, body, **kwargs): # noqa: E501 + """Generate access key for storage buckets # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.generate_object_storage_key(project_id, id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param object body: (required) + :return: ObjectStorageKey + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.generate_object_storage_key_with_http_info(project_id, id, body, **kwargs) # noqa: E501 + else: + (data) = self.generate_object_storage_key_with_http_info(project_id, id, body, **kwargs) # noqa: E501 + return data + + def generate_object_storage_key_with_http_info(self, project_id, id, body, **kwargs): # noqa: E501 + """Generate access key for storage buckets # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.generate_object_storage_key_with_http_info(project_id, id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param object body: (required) + :return: ObjectStorageKey + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method generate_object_storage_key" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `generate_object_storage_key`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `generate_object_storage_key`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `generate_object_storage_key`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/object-storage/users/{id}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ObjectStorageKey', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_object_storage_bucket(self, project_id, id, **kwargs): # noqa: E501 + """Get details for a bucket # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_object_storage_bucket(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: ObjectStorageBucket + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_object_storage_bucket_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.get_object_storage_bucket_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def get_object_storage_bucket_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Get details for a bucket # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_object_storage_bucket_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: ObjectStorageBucket + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_object_storage_bucket" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `get_object_storage_bucket`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_object_storage_bucket`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/object-storage/buckets/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ObjectStorageBucket', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_object_storage_session_key(self, project_id, **kwargs): # noqa: E501 + """Generate temporary key for storage bucket access # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_object_storage_session_key(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str data_center_id: + :return: GetObjectStorageSessionKeyResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_object_storage_session_key_with_http_info(project_id, **kwargs) # noqa: E501 + else: + (data) = self.get_object_storage_session_key_with_http_info(project_id, **kwargs) # noqa: E501 + return data + + def get_object_storage_session_key_with_http_info(self, project_id, **kwargs): # noqa: E501 + """Generate temporary key for storage bucket access # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_object_storage_session_key_with_http_info(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str data_center_id: + :return: GetObjectStorageSessionKeyResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'data_center_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_object_storage_session_key" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `get_object_storage_session_key`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + if 'data_center_id' in params: + query_params.append(('dataCenterId', params['data_center_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/object-storage/session-key', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GetObjectStorageSessionKeyResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_object_storage_buckets(self, project_id, **kwargs): # noqa: E501 + """List buckets # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_object_storage_buckets(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param int page_number: + :param int page_size: + :return: ListObjectStorageBucketsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_object_storage_buckets_with_http_info(project_id, **kwargs) # noqa: E501 + else: + (data) = self.list_object_storage_buckets_with_http_info(project_id, **kwargs) # noqa: E501 + return data + + def list_object_storage_buckets_with_http_info(self, project_id, **kwargs): # noqa: E501 + """List buckets # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_object_storage_buckets_with_http_info(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param int page_number: + :param int page_size: + :return: ListObjectStorageBucketsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'page_number', 'page_size'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_object_storage_buckets" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `list_object_storage_buckets`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + if 'page_number' in params: + query_params.append(('pageNumber', params['page_number'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/object-storage/buckets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListObjectStorageBucketsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_object_storage_keys(self, project_id, id, **kwargs): # noqa: E501 + """List storage user keys # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_object_storage_keys(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param int page_number: + :param int page_size: + :return: ListObjectStorageKeysResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_object_storage_keys_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.list_object_storage_keys_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def list_object_storage_keys_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """List storage user keys # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_object_storage_keys_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param int page_number: + :param int page_size: + :return: ListObjectStorageKeysResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id', 'page_number', 'page_size'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_object_storage_keys" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `list_object_storage_keys`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `list_object_storage_keys`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'page_number' in params: + query_params.append(('pageNumber', params['page_number'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/object-storage/users/{id}/keys', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListObjectStorageKeysResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_object_storage_users(self, project_id, **kwargs): # noqa: E501 + """List storage users # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_object_storage_users(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param int page_number: + :param int page_size: + :return: ListObjectStorageUsersResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_object_storage_users_with_http_info(project_id, **kwargs) # noqa: E501 + else: + (data) = self.list_object_storage_users_with_http_info(project_id, **kwargs) # noqa: E501 + return data + + def list_object_storage_users_with_http_info(self, project_id, **kwargs): # noqa: E501 + """List storage users # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_object_storage_users_with_http_info(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param int page_number: + :param int page_size: + :return: ListObjectStorageUsersResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'page_number', 'page_size'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_object_storage_users" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `list_object_storage_users`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + if 'page_number' in params: + query_params.append(('pageNumber', params['page_number'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/object-storage/users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListObjectStorageUsersResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/cudo_compute/api/permissions_api.py b/src/cudo_compute/api/permissions_api.py new file mode 100644 index 0000000..fcee8e0 --- /dev/null +++ b/src/cudo_compute/api/permissions_api.py @@ -0,0 +1,765 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from src.cudo_compute.api_client import ApiClient + + +class PermissionsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def add_billing_account_user_permission(self, billing_account_id, body, **kwargs): # noqa: E501 + """Add billing account user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_billing_account_user_permission(billing_account_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str billing_account_id: (required) + :param Body body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.add_billing_account_user_permission_with_http_info(billing_account_id, body, **kwargs) # noqa: E501 + else: + (data) = self.add_billing_account_user_permission_with_http_info(billing_account_id, body, **kwargs) # noqa: E501 + return data + + def add_billing_account_user_permission_with_http_info(self, billing_account_id, body, **kwargs): # noqa: E501 + """Add billing account user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_billing_account_user_permission_with_http_info(billing_account_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str billing_account_id: (required) + :param Body body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['billing_account_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_billing_account_user_permission" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'billing_account_id' is set + if self.api_client.client_side_validation and ('billing_account_id' not in params or + params['billing_account_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `billing_account_id` when calling `add_billing_account_user_permission`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `add_billing_account_user_permission`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'billing_account_id' in params: + path_params['billingAccountId'] = params['billing_account_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/billing-accounts/{billingAccountId}/add-user-permission', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def add_data_center_user_permission(self, data_center_id, body, **kwargs): # noqa: E501 + """Add data center user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_data_center_user_permission(data_center_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str data_center_id: (required) + :param Body2 body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.add_data_center_user_permission_with_http_info(data_center_id, body, **kwargs) # noqa: E501 + else: + (data) = self.add_data_center_user_permission_with_http_info(data_center_id, body, **kwargs) # noqa: E501 + return data + + def add_data_center_user_permission_with_http_info(self, data_center_id, body, **kwargs): # noqa: E501 + """Add data center user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_data_center_user_permission_with_http_info(data_center_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str data_center_id: (required) + :param Body2 body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['data_center_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_data_center_user_permission" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'data_center_id' is set + if self.api_client.client_side_validation and ('data_center_id' not in params or + params['data_center_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `data_center_id` when calling `add_data_center_user_permission`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `add_data_center_user_permission`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'data_center_id' in params: + path_params['dataCenterId'] = params['data_center_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/data-centers/{dataCenterId}/add-user-permission', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def add_project_user_permission(self, project_id, body, **kwargs): # noqa: E501 + """Add project user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_project_user_permission(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Body4 body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.add_project_user_permission_with_http_info(project_id, body, **kwargs) # noqa: E501 + else: + (data) = self.add_project_user_permission_with_http_info(project_id, body, **kwargs) # noqa: E501 + return data + + def add_project_user_permission_with_http_info(self, project_id, body, **kwargs): # noqa: E501 + """Add project user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_project_user_permission_with_http_info(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Body4 body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_project_user_permission" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `add_project_user_permission`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `add_project_user_permission`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/add-user-permission', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_user_permissions(self, **kwargs): # noqa: E501 + """List # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_user_permissions(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: + :param str data_center_id: + :param str billing_account_id: + :return: ListUserPermissionsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_user_permissions_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.list_user_permissions_with_http_info(**kwargs) # noqa: E501 + return data + + def list_user_permissions_with_http_info(self, **kwargs): # noqa: E501 + """List # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_user_permissions_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: + :param str data_center_id: + :param str billing_account_id: + :return: ListUserPermissionsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'data_center_id', 'billing_account_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_user_permissions" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'project_id' in params: + query_params.append(('projectId', params['project_id'])) # noqa: E501 + if 'data_center_id' in params: + query_params.append(('dataCenterId', params['data_center_id'])) # noqa: E501 + if 'billing_account_id' in params: + query_params.append(('billingAccountId', params['billing_account_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/auth/permissions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListUserPermissionsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def remove_billing_account_user_permission(self, billing_account_id, body, **kwargs): # noqa: E501 + """Remove billing account user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_billing_account_user_permission(billing_account_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str billing_account_id: (required) + :param Body1 body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.remove_billing_account_user_permission_with_http_info(billing_account_id, body, **kwargs) # noqa: E501 + else: + (data) = self.remove_billing_account_user_permission_with_http_info(billing_account_id, body, **kwargs) # noqa: E501 + return data + + def remove_billing_account_user_permission_with_http_info(self, billing_account_id, body, **kwargs): # noqa: E501 + """Remove billing account user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_billing_account_user_permission_with_http_info(billing_account_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str billing_account_id: (required) + :param Body1 body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['billing_account_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_billing_account_user_permission" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'billing_account_id' is set + if self.api_client.client_side_validation and ('billing_account_id' not in params or + params['billing_account_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `billing_account_id` when calling `remove_billing_account_user_permission`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `remove_billing_account_user_permission`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'billing_account_id' in params: + path_params['billingAccountId'] = params['billing_account_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/billing-accounts/{billingAccountId}/remove-user-permission', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def remove_data_center_user_permission(self, data_center_id, body, **kwargs): # noqa: E501 + """Remove data center user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_data_center_user_permission(data_center_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str data_center_id: (required) + :param Body3 body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.remove_data_center_user_permission_with_http_info(data_center_id, body, **kwargs) # noqa: E501 + else: + (data) = self.remove_data_center_user_permission_with_http_info(data_center_id, body, **kwargs) # noqa: E501 + return data + + def remove_data_center_user_permission_with_http_info(self, data_center_id, body, **kwargs): # noqa: E501 + """Remove data center user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_data_center_user_permission_with_http_info(data_center_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str data_center_id: (required) + :param Body3 body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['data_center_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_data_center_user_permission" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'data_center_id' is set + if self.api_client.client_side_validation and ('data_center_id' not in params or + params['data_center_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `data_center_id` when calling `remove_data_center_user_permission`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `remove_data_center_user_permission`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'data_center_id' in params: + path_params['dataCenterId'] = params['data_center_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/data-centers/{dataCenterId}/remove-user-permission', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def remove_project_user_permission(self, project_id, body, **kwargs): # noqa: E501 + """Remove project user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_project_user_permission(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Body10 body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.remove_project_user_permission_with_http_info(project_id, body, **kwargs) # noqa: E501 + else: + (data) = self.remove_project_user_permission_with_http_info(project_id, body, **kwargs) # noqa: E501 + return data + + def remove_project_user_permission_with_http_info(self, project_id, body, **kwargs): # noqa: E501 + """Remove project user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_project_user_permission_with_http_info(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Body10 body: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_project_user_permission" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `remove_project_user_permission`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `remove_project_user_permission`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/remove-user-permission', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/cudo_compute/api/projects_api.py b/src/cudo_compute/api/projects_api.py new file mode 100644 index 0000000..6dfd1ce --- /dev/null +++ b/src/cudo_compute/api/projects_api.py @@ -0,0 +1,624 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from src.cudo_compute.api_client import ApiClient + + +class ProjectsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_project(self, project, **kwargs): # noqa: E501 + """Create # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_project(project, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Project project: (required) + :return: Project + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_project_with_http_info(project, **kwargs) # noqa: E501 + else: + (data) = self.create_project_with_http_info(project, **kwargs) # noqa: E501 + return data + + def create_project_with_http_info(self, project, **kwargs): # noqa: E501 + """Create # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_project_with_http_info(project, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Project project: (required) + :return: Project + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project' is set + if self.api_client.client_side_validation and ('project' not in params or + params['project'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project` when calling `create_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'project' in params: + body_params = params['project'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Project', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_project(self, id, **kwargs): # noqa: E501 + """Delete # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_project(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_project_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.delete_project_with_http_info(id, **kwargs) # noqa: E501 + return data + + def delete_project_with_http_info(self, id, **kwargs): # noqa: E501 + """Delete # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_project_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `delete_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_project(self, id, **kwargs): # noqa: E501 + """Get # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: Project + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_project_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_project_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_project_with_http_info(self, id, **kwargs): # noqa: E501 + """Get # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: Project + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Project', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_project_ssh_keys(self, project_id, **kwargs): # noqa: E501 + """List SSH keys # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_project_ssh_keys(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :return: ListProjectSshKeysResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_project_ssh_keys_with_http_info(project_id, **kwargs) # noqa: E501 + else: + (data) = self.list_project_ssh_keys_with_http_info(project_id, **kwargs) # noqa: E501 + return data + + def list_project_ssh_keys_with_http_info(self, project_id, **kwargs): # noqa: E501 + """List SSH keys # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_project_ssh_keys_with_http_info(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :return: ListProjectSshKeysResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_project_ssh_keys" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `list_project_ssh_keys`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/project/{projectId}/ssh-keys', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListProjectSshKeysResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_projects(self, **kwargs): # noqa: E501 + """List # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_projects(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str page_token: + :param int page_size: + :return: ListProjectsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_projects_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.list_projects_with_http_info(**kwargs) # noqa: E501 + return data + + def list_projects_with_http_info(self, **kwargs): # noqa: E501 + """List # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_projects_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str page_token: + :param int page_size: + :return: ListProjectsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['page_token', 'page_size'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_projects" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListProjectsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_project(self, project_id, project, **kwargs): # noqa: E501 + """Update # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_project(project_id, project, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Project project: (required) + :return: Project + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_project_with_http_info(project_id, project, **kwargs) # noqa: E501 + else: + (data) = self.update_project_with_http_info(project_id, project, **kwargs) # noqa: E501 + return data + + def update_project_with_http_info(self, project_id, project, **kwargs): # noqa: E501 + """Update # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_project_with_http_info(project_id, project, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Project project: (required) + :return: Project + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'project'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `update_project`") # noqa: E501 + # verify the required parameter 'project' is set + if self.api_client.client_side_validation and ('project' not in params or + params['project'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project` when calling `update_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['project.id'] = params['project_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'project' in params: + body_params = params['project'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{project.id}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Project', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/cudo_compute/api/search_api.py b/src/cudo_compute/api/search_api.py new file mode 100644 index 0000000..524244c --- /dev/null +++ b/src/cudo_compute/api/search_api.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from src.cudo_compute.api_client import ApiClient + + +class SearchApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def list_regions(self, **kwargs): # noqa: E501 + """Regions # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_regions(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: ListRegionsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_regions_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.list_regions_with_http_info(**kwargs) # noqa: E501 + return data + + def list_regions_with_http_info(self, **kwargs): # noqa: E501 + """Regions # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_regions_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: ListRegionsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_regions" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/regions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListRegionsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/cudo_compute/api/ssh_keys_api.py b/src/cudo_compute/api/ssh_keys_api.py new file mode 100644 index 0000000..a78e7bb --- /dev/null +++ b/src/cudo_compute/api/ssh_keys_api.py @@ -0,0 +1,422 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from src.cudo_compute.api_client import ApiClient + + +class SSHKeysApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_ssh_key(self, ssh_key, **kwargs): # noqa: E501 + """Create # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_ssh_key(ssh_key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SshKey ssh_key: (required) + :return: SshKey + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_ssh_key_with_http_info(ssh_key, **kwargs) # noqa: E501 + else: + (data) = self.create_ssh_key_with_http_info(ssh_key, **kwargs) # noqa: E501 + return data + + def create_ssh_key_with_http_info(self, ssh_key, **kwargs): # noqa: E501 + """Create # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_ssh_key_with_http_info(ssh_key, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SshKey ssh_key: (required) + :return: SshKey + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['ssh_key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_ssh_key" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'ssh_key' is set + if self.api_client.client_side_validation and ('ssh_key' not in params or + params['ssh_key'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `ssh_key` when calling `create_ssh_key`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'ssh_key' in params: + body_params = params['ssh_key'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/ssh-keys', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SshKey', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_ssh_key(self, id, **kwargs): # noqa: E501 + """Delete # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_ssh_key(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_ssh_key_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.delete_ssh_key_with_http_info(id, **kwargs) # noqa: E501 + return data + + def delete_ssh_key_with_http_info(self, id, **kwargs): # noqa: E501 + """Delete # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_ssh_key_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_ssh_key" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `delete_ssh_key`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/ssh-keys/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_ssh_key(self, id, **kwargs): # noqa: E501 + """Get # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_ssh_key(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: SshKey + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_ssh_key_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_ssh_key_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_ssh_key_with_http_info(self, id, **kwargs): # noqa: E501 + """Get # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_ssh_key_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: SshKey + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_ssh_key" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_ssh_key`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/ssh-keys/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SshKey', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_ssh_keys(self, **kwargs): # noqa: E501 + """List # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_ssh_keys(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int page_number: + :param int page_size: + :return: ListSshKeysResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_ssh_keys_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.list_ssh_keys_with_http_info(**kwargs) # noqa: E501 + return data + + def list_ssh_keys_with_http_info(self, **kwargs): # noqa: E501 + """List # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_ssh_keys_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int page_number: + :param int page_size: + :return: ListSshKeysResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['page_number', 'page_size'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_ssh_keys" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'page_number' in params: + query_params.append(('pageNumber', params['page_number'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/ssh-keys', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListSshKeysResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/cudo_compute/api/user_api.py b/src/cudo_compute/api/user_api.py new file mode 100644 index 0000000..c5081be --- /dev/null +++ b/src/cudo_compute/api/user_api.py @@ -0,0 +1,305 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from src.cudo_compute.api_client import ApiClient + + +class UserApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_identity_verification_session(self, **kwargs): # noqa: E501 + """Get identity verification session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_identity_verification_session(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: IdentityVerificationSession + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_identity_verification_session_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.create_identity_verification_session_with_http_info(**kwargs) # noqa: E501 + return data + + def create_identity_verification_session_with_http_info(self, **kwargs): # noqa: E501 + """Get identity verification session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_identity_verification_session_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: IdentityVerificationSession + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_identity_verification_session" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/auth/create-identity-verification-session', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='IdentityVerificationSession', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_user(self, **kwargs): # noqa: E501 + """Delete # noqa: E501 + + Deletes your user, deleting all records of your user, and revoking access to every resource. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_user(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_user_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.delete_user_with_http_info(**kwargs) # noqa: E501 + return data + + def delete_user_with_http_info(self, **kwargs): # noqa: E501 + """Delete # noqa: E501 + + Deletes your user, deleting all records of your user, and revoking access to every resource. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_user_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_user" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/auth', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get(self, **kwargs): # noqa: E501 + """Get # noqa: E501 + + Responds with details of the user when suitable authentication material is sent with the request. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: Profile + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_with_http_info(**kwargs) # noqa: E501 + return data + + def get_with_http_info(self, **kwargs): # noqa: E501 + """Get # noqa: E501 + + Responds with details of the user when suitable authentication material is sent with the request. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: Profile + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/auth', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Profile', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/cudo_compute/api/virtual_machines_api.py b/src/cudo_compute/api/virtual_machines_api.py new file mode 100644 index 0000000..c011e94 --- /dev/null +++ b/src/cudo_compute/api/virtual_machines_api.py @@ -0,0 +1,2280 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from src.cudo_compute.api_client import ApiClient + + +class VirtualMachinesApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def connect_vm(self, project_id, id, **kwargs): # noqa: E501 + """Connect via VNC # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connect_vm(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str connection_id: + :return: ConnectVMResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connect_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.connect_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def connect_vm_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Connect via VNC # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connect_vm_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str connection_id: + :return: ConnectVMResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id', 'connection_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_vm" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `connect_vm`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `connect_vm`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'connection_id' in params: + query_params.append(('connectionId', params['connection_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/vms/{id}/connect', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ConnectVMResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def count_vms(self, project_id, **kwargs): # noqa: E501 + """Count # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.count_vms(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :return: CountVMsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.count_vms_with_http_info(project_id, **kwargs) # noqa: E501 + else: + (data) = self.count_vms_with_http_info(project_id, **kwargs) # noqa: E501 + return data + + def count_vms_with_http_info(self, project_id, **kwargs): # noqa: E501 + """Count # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.count_vms_with_http_info(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :return: CountVMsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method count_vms" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `count_vms`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/count-vms', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CountVMsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_private_vm_image(self, project_id, vm_id, id, **kwargs): # noqa: E501 + """Create private VM image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_private_vm_image(project_id, vm_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str vm_id: (required) + :param str id: (required) + :param str description: + :return: CreatePrivateVMImageResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_private_vm_image_with_http_info(project_id, vm_id, id, **kwargs) # noqa: E501 + else: + (data) = self.create_private_vm_image_with_http_info(project_id, vm_id, id, **kwargs) # noqa: E501 + return data + + def create_private_vm_image_with_http_info(self, project_id, vm_id, id, **kwargs): # noqa: E501 + """Create private VM image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_private_vm_image_with_http_info(project_id, vm_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str vm_id: (required) + :param str id: (required) + :param str description: + :return: CreatePrivateVMImageResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'vm_id', 'id', 'description'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_private_vm_image" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `create_private_vm_image`") # noqa: E501 + # verify the required parameter 'vm_id' is set + if self.api_client.client_side_validation and ('vm_id' not in params or + params['vm_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `vm_id` when calling `create_private_vm_image`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `create_private_vm_image`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + if 'vm_id' in params: + query_params.append(('vmId', params['vm_id'])) # noqa: E501 + if 'id' in params: + query_params.append(('id', params['id'])) # noqa: E501 + if 'description' in params: + query_params.append(('description', params['description'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/images', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CreatePrivateVMImageResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_vm(self, project_id, body, **kwargs): # noqa: E501 + """Create virtual machine # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_vm(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Body11 body: (required) + :return: CreateVMResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_vm_with_http_info(project_id, body, **kwargs) # noqa: E501 + else: + (data) = self.create_vm_with_http_info(project_id, body, **kwargs) # noqa: E501 + return data + + def create_vm_with_http_info(self, project_id, body, **kwargs): # noqa: E501 + """Create virtual machine # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_vm_with_http_info(project_id, body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param Body11 body: (required) + :return: CreateVMResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_vm" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `create_vm`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `create_vm`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/vm', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CreateVMResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_private_vm_image(self, project_id, id, **kwargs): # noqa: E501 + """Delete private VM image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_private_vm_image(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: DeletePrivateVMImageResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_private_vm_image_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.delete_private_vm_image_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def delete_private_vm_image_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Delete private VM image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_private_vm_image_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: DeletePrivateVMImageResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_private_vm_image" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `delete_private_vm_image`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `delete_private_vm_image`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/images/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DeletePrivateVMImageResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_private_vm_image(self, project_id, id, **kwargs): # noqa: E501 + """Get private VM image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_private_vm_image(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: GetPrivateVMImageResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_private_vm_image_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.get_private_vm_image_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def get_private_vm_image_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Get private VM image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_private_vm_image_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: GetPrivateVMImageResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_private_vm_image" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `get_private_vm_image`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_private_vm_image`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/images/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GetPrivateVMImageResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_vm(self, project_id, id, **kwargs): # noqa: E501 + """Get # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vm(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: GetVMResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.get_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def get_vm_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Get # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vm_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: GetVMResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_vm" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `get_vm`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_vm`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/vms/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GetVMResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_private_vm_images(self, project_id, **kwargs): # noqa: E501 + """List private VM images # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_private_vm_images(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param int page_number: + :param int page_size: + :return: ListPrivateVMImagesResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_private_vm_images_with_http_info(project_id, **kwargs) # noqa: E501 + else: + (data) = self.list_private_vm_images_with_http_info(project_id, **kwargs) # noqa: E501 + return data + + def list_private_vm_images_with_http_info(self, project_id, **kwargs): # noqa: E501 + """List private VM images # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_private_vm_images_with_http_info(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param int page_number: + :param int page_size: + :return: ListPrivateVMImagesResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'page_number', 'page_size'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_private_vm_images" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `list_private_vm_images`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + if 'page_number' in params: + query_params.append(('pageNumber', params['page_number'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/images', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListPrivateVMImagesResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_public_vm_images(self, **kwargs): # noqa: E501 + """List public VM images # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_public_vm_images(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: ListPublicVMImagesResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_public_vm_images_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.list_public_vm_images_with_http_info(**kwargs) # noqa: E501 + return data + + def list_public_vm_images_with_http_info(self, **kwargs): # noqa: E501 + """List public VM images # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_public_vm_images_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: ListPublicVMImagesResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_public_vm_images" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/vms/public-images', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListPublicVMImagesResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_vm_data_centers(self, **kwargs): # noqa: E501 + """List data centers # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_vm_data_centers(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] region_id: + :param bool renewable_energy: + :return: ListVMDataCentersResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_vm_data_centers_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.list_vm_data_centers_with_http_info(**kwargs) # noqa: E501 + return data + + def list_vm_data_centers_with_http_info(self, **kwargs): # noqa: E501 + """List data centers # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_vm_data_centers_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] region_id: + :param bool renewable_energy: + :return: ListVMDataCentersResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['region_id', 'renewable_energy'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_vm_data_centers" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'region_id' in params: + query_params.append(('regionId', params['region_id'])) # noqa: E501 + collection_formats['regionId'] = 'multi' # noqa: E501 + if 'renewable_energy' in params: + query_params.append(('renewableEnergy', params['renewable_energy'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/vms/data-centers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListVMDataCentersResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_vm_disks(self, project_id, id, **kwargs): # noqa: E501 + """List disks attached to VM # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_vm_disks(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: ListVMDisksResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_vm_disks_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.list_vm_disks_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def list_vm_disks_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """List disks attached to VM # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_vm_disks_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: ListVMDisksResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_vm_disks" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `list_vm_disks`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `list_vm_disks`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/vms/{id}/disks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListVMDisksResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_vm_machine_types(self, memory_gib, vcpu, **kwargs): # noqa: E501 + """List machine types # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_vm_machine_types(memory_gib, vcpu, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int memory_gib: (required) + :param int vcpu: (required) + :param str cpu_model: + :param int gpu: + :param str gpu_model: + :param str order_by: + :param int page_number: + :param int page_size: + :param str region_id: + :param int storage_gib: + :param str data_center_id: + :param bool public_ipv4: + :return: ListVMMachineTypesResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_vm_machine_types_with_http_info(memory_gib, vcpu, **kwargs) # noqa: E501 + else: + (data) = self.list_vm_machine_types_with_http_info(memory_gib, vcpu, **kwargs) # noqa: E501 + return data + + def list_vm_machine_types_with_http_info(self, memory_gib, vcpu, **kwargs): # noqa: E501 + """List machine types # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_vm_machine_types_with_http_info(memory_gib, vcpu, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int memory_gib: (required) + :param int vcpu: (required) + :param str cpu_model: + :param int gpu: + :param str gpu_model: + :param str order_by: + :param int page_number: + :param int page_size: + :param str region_id: + :param int storage_gib: + :param str data_center_id: + :param bool public_ipv4: + :return: ListVMMachineTypesResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['memory_gib', 'vcpu', 'cpu_model', 'gpu', 'gpu_model', 'order_by', 'page_number', 'page_size', 'region_id', 'storage_gib', 'data_center_id', 'public_ipv4'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_vm_machine_types" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'memory_gib' is set + if self.api_client.client_side_validation and ('memory_gib' not in params or + params['memory_gib'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `memory_gib` when calling `list_vm_machine_types`") # noqa: E501 + # verify the required parameter 'vcpu' is set + if self.api_client.client_side_validation and ('vcpu' not in params or + params['vcpu'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `vcpu` when calling `list_vm_machine_types`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'cpu_model' in params: + query_params.append(('cpuModel', params['cpu_model'])) # noqa: E501 + if 'gpu' in params: + query_params.append(('gpu', params['gpu'])) # noqa: E501 + if 'gpu_model' in params: + query_params.append(('gpuModel', params['gpu_model'])) # noqa: E501 + if 'memory_gib' in params: + query_params.append(('memoryGib', params['memory_gib'])) # noqa: E501 + if 'order_by' in params: + query_params.append(('orderBy', params['order_by'])) # noqa: E501 + if 'page_number' in params: + query_params.append(('pageNumber', params['page_number'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + if 'region_id' in params: + query_params.append(('regionId', params['region_id'])) # noqa: E501 + if 'storage_gib' in params: + query_params.append(('storageGib', params['storage_gib'])) # noqa: E501 + if 'vcpu' in params: + query_params.append(('vcpu', params['vcpu'])) # noqa: E501 + if 'data_center_id' in params: + query_params.append(('dataCenterId', params['data_center_id'])) # noqa: E501 + if 'public_ipv4' in params: + query_params.append(('publicIpv4', params['public_ipv4'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/vms/machine-types', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListVMMachineTypesResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def list_vms(self, project_id, **kwargs): # noqa: E501 + """List # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_vms(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str network_id: + :return: ListVMsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_vms_with_http_info(project_id, **kwargs) # noqa: E501 + else: + (data) = self.list_vms_with_http_info(project_id, **kwargs) # noqa: E501 + return data + + def list_vms_with_http_info(self, project_id, **kwargs): # noqa: E501 + """List # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_vms_with_http_info(project_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str network_id: + :return: ListVMsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'network_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method list_vms" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `list_vms`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + + query_params = [] + if 'network_id' in params: + query_params.append(('networkId', params['network_id'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/vms', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ListVMsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def monitor_vm(self, project_id, id, **kwargs): # noqa: E501 + """Monitor # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.monitor_vm(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: MonitorVMResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.monitor_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.monitor_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def monitor_vm_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Monitor # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.monitor_vm_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: MonitorVMResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method monitor_vm" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `monitor_vm`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `monitor_vm`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/vms/{id}/monitor', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MonitorVMResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def reboot_vm(self, project_id, id, **kwargs): # noqa: E501 + """Reboot # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.reboot_vm(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: RebootVMResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.reboot_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.reboot_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def reboot_vm_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Reboot # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.reboot_vm_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: RebootVMResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method reboot_vm" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `reboot_vm`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `reboot_vm`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/vms/{id}/reboot', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='RebootVMResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def resize_vm(self, project_id, id, **kwargs): # noqa: E501 + """Resize vCPU and memory of VM # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resize_vm(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param int vcpus: + :param int memory_gib: + :return: ResizeVMResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.resize_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.resize_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def resize_vm_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Resize vCPU and memory of VM # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resize_vm_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param int vcpus: + :param int memory_gib: + :return: ResizeVMResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id', 'vcpus', 'memory_gib'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method resize_vm" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `resize_vm`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `resize_vm`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'vcpus' in params: + query_params.append(('vcpus', params['vcpus'])) # noqa: E501 + if 'memory_gib' in params: + query_params.append(('memoryGib', params['memory_gib'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/vms/{id}/resize', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ResizeVMResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def resize_vm_disk(self, project_id, id, **kwargs): # noqa: E501 + """Resize a VM's disk # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resize_vm_disk(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str disk_id: + :param int size_gib: + :return: ResizeVMDiskResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.resize_vm_disk_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.resize_vm_disk_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def resize_vm_disk_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Resize a VM's disk # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.resize_vm_disk_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str disk_id: + :param int size_gib: + :return: ResizeVMDiskResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id', 'disk_id', 'size_gib'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method resize_vm_disk" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `resize_vm_disk`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `resize_vm_disk`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'disk_id' in params: + query_params.append(('diskId', params['disk_id'])) # noqa: E501 + if 'size_gib' in params: + query_params.append(('sizeGib', params['size_gib'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/vms/{id}/disks', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ResizeVMDiskResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def start_vm(self, project_id, id, **kwargs): # noqa: E501 + """Start # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.start_vm(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: StartVMResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.start_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.start_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def start_vm_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Start # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.start_vm_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: StartVMResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method start_vm" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `start_vm`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `start_vm`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/vms/{id}/start', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='StartVMResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def stop_vm(self, project_id, id, **kwargs): # noqa: E501 + """Stop # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.stop_vm(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: StopVMResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.stop_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.stop_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def stop_vm_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Stop # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.stop_vm_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: StopVMResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method stop_vm" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `stop_vm`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `stop_vm`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/vms/{id}/stop', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='StopVMResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def terminate_vm(self, project_id, id, **kwargs): # noqa: E501 + """Terminate # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.terminate_vm(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: TerminateVMResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.terminate_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.terminate_vm_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def terminate_vm_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Terminate # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.terminate_vm_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :return: TerminateVMResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method terminate_vm" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `terminate_vm`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `terminate_vm`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/vms/{id}/terminate', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TerminateVMResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_private_vm_image(self, project_id, id, **kwargs): # noqa: E501 + """Update private VM image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_private_vm_image(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str description: + :return: UpdatePrivateVMImageResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_private_vm_image_with_http_info(project_id, id, **kwargs) # noqa: E501 + else: + (data) = self.update_private_vm_image_with_http_info(project_id, id, **kwargs) # noqa: E501 + return data + + def update_private_vm_image_with_http_info(self, project_id, id, **kwargs): # noqa: E501 + """Update private VM image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_private_vm_image_with_http_info(project_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_id: (required) + :param str id: (required) + :param str description: + :return: UpdatePrivateVMImageResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_id', 'id', 'description'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_private_vm_image" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_id' is set + if self.api_client.client_side_validation and ('project_id' not in params or + params['project_id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `project_id` when calling `update_private_vm_image`") # noqa: E501 + # verify the required parameter 'id' is set + if self.api_client.client_side_validation and ('id' not in params or + params['id'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `update_private_vm_image`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_id' in params: + path_params['projectId'] = params['project_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'description' in params: + query_params.append(('description', params['description'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/v1/projects/{projectId}/images/{id}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UpdatePrivateVMImageResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/src/cudo_compute/api_client.py b/src/cudo_compute/api_client.py new file mode 100644 index 0000000..cbeb5c9 --- /dev/null +++ b/src/cudo_compute/api_client.py @@ -0,0 +1,639 @@ +# coding: utf-8 +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import datetime +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from src.cudo_compute.configuration import Configuration +import src.cudo_compute.models +from src.cudo_compute import rest + + +class ApiClient(object): + """Generic API client for Swagger client library builds. + + Swagger generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the Swagger + templates. + + NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + + # Use the pool property to lazily initialize the ThreadPool. + self._pool = None + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'Swagger-Codegen/1.0.0/python' + self.client_side_validation = configuration.client_side_validation + + def __del__(self): + if self._pool is not None: + self._pool.close() + self._pool.join() + + @property + def pool(self): + if self._pool is None: + self._pool = ThreadPool() + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = self.prepare_post_parameters(post_params, files) + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + url = self.configuration.host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is swagger model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `swagger_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.swagger_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(src.cudo_compute.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, _request_timeout)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def prepare_post_parameters(self, post_params=None, files=None): + """Builds form parameters. + + :param post_params: Normal form parameters. + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if post_params: + params = post_params + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "w") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return a original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __hasattr(self, object, name): + return name in object.__class__.__dict__ + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if (not klass.swagger_types and + not self.__hasattr(klass, 'get_real_child_model')): + return data + + kwargs = {} + if klass.swagger_types is not None: + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if (isinstance(instance, dict) and + klass.swagger_types is not None and + isinstance(data, dict)): + for key, value in data.items(): + if key not in klass.swagger_types: + instance[key] = value + if self.__hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/src/cudo_compute/configuration.py b/src/cudo_compute/configuration.py new file mode 100644 index 0000000..e8f9688 --- /dev/null +++ b/src/cudo_compute/configuration.py @@ -0,0 +1,248 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import copy +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class Configuration(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + """ + + _default = None + + def __init__(self): + """Constructor""" + if self._default: + for key in self._default.__dict__.keys(): + self.__dict__[key] = copy.copy(self._default.__dict__[key]) + return + + # Default Base url + self.host = "https://rest.compute.cudo.org" + # Temp file folder for downloading files + self.temp_folder_path = None + + # Authentication Settings + # dict to store API key(s) + self.api_key = {} + # dict to store API prefix (e.g. Bearer) + self.api_key_prefix = {} + # function to refresh API key if expired + self.refresh_api_key_hook = None + # Username for HTTP basic authentication + self.username = "" + # Password for HTTP basic authentication + self.password = "" + + # Logging Settings + self.logger = {} + self.logger["package_logger"] = logging.getLogger("src.cudo_compute") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + # Log format + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + # Log stream handler + self.logger_stream_handler = None + # Log file handler + self.logger_file_handler = None + # Debug file location + self.logger_file = None + # Debug switch + self.debug = False + + # SSL/TLS verification + # Set this to false to skip verifying SSL certificate when calling API + # from https server. + self.verify_ssl = True + # Set this to customize the certificate file to verify the peer. + self.ssl_ca_cert = None + # client certificate file + self.cert_file = None + # client key file + self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + + # Proxy URL + self.proxy = None + # Safe chars for path_param + self.safe_chars_for_path_param = '' + + # Disable client side validation + self.client_side_validation = True + + @classmethod + def set_default(cls, default): + cls._default = default + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + if self.logger_stream_handler: + logger.removeHandler(self.logger_stream_handler) + else: + # If not set logging file, + # then add stream handler and remove file handler. + self.logger_stream_handler = logging.StreamHandler() + self.logger_stream_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_stream_handler) + if self.logger_file_handler: + logger.removeHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + + if self.refresh_api_key_hook: + self.refresh_api_key_hook(self) + + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + + } + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) diff --git a/src/cudo_compute/models/__init__.py b/src/cudo_compute/models/__init__.py new file mode 100644 index 0000000..520791d --- /dev/null +++ b/src/cudo_compute/models/__init__.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +# flake8: noqa +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +# import models into model package +from src.cudo_compute.models.any import Any +from src.cudo_compute.models.api_key import ApiKey +from src.cudo_compute.models.attach_storage_disk_response import AttachStorageDiskResponse +from src.cudo_compute.models.body import Body +from src.cudo_compute.models.body1 import Body1 +from src.cudo_compute.models.body10 import Body10 +from src.cudo_compute.models.body11 import Body11 +from src.cudo_compute.models.body2 import Body2 +from src.cudo_compute.models.body3 import Body3 +from src.cudo_compute.models.body4 import Body4 +from src.cudo_compute.models.body5 import Body5 +from src.cudo_compute.models.body6 import Body6 +from src.cudo_compute.models.body7 import Body7 +from src.cudo_compute.models.body8 import Body8 +from src.cudo_compute.models.body9 import Body9 +from src.cudo_compute.models.connect_vm_response import ConnectVMResponse +from src.cudo_compute.models.count_vms_response import CountVMsResponse +from src.cudo_compute.models.cpu_model_category import CpuModelCategory +from src.cudo_compute.models.create_disk_snapshot_response import CreateDiskSnapshotResponse +from src.cudo_compute.models.create_network_response import CreateNetworkResponse +from src.cudo_compute.models.create_private_vm_image_response import CreatePrivateVMImageResponse +from src.cudo_compute.models.create_security_group_response import CreateSecurityGroupResponse +from src.cudo_compute.models.create_storage_disk_response import CreateStorageDiskResponse +from src.cudo_compute.models.create_vm_request_nic import CreateVMRequestNIC +from src.cudo_compute.models.create_vm_response import CreateVMResponse +from src.cudo_compute.models.data_center_category import DataCenterCategory +from src.cudo_compute.models.decimal import Decimal +from src.cudo_compute.models.delete_disk_snapshot_response import DeleteDiskSnapshotResponse +from src.cudo_compute.models.delete_network_response import DeleteNetworkResponse +from src.cudo_compute.models.delete_object_storage_key_response import DeleteObjectStorageKeyResponse +from src.cudo_compute.models.delete_object_storage_user_response import DeleteObjectStorageUserResponse +from src.cudo_compute.models.delete_private_vm_image_response import DeletePrivateVMImageResponse +from src.cudo_compute.models.delete_security_group_response import DeleteSecurityGroupResponse +from src.cudo_compute.models.delete_storage_disk_response import DeleteStorageDiskResponse +from src.cudo_compute.models.detach_storage_disk_response import DetachStorageDiskResponse +from src.cudo_compute.models.disk import Disk +from src.cudo_compute.models.disk_state import DiskState +from src.cudo_compute.models.disk_storage_class import DiskStorageClass +from src.cudo_compute.models.disk_storage_price_hr import DiskStoragePriceHr +from src.cudo_compute.models.disk_type import DiskType +from src.cudo_compute.models.generate_api_key_request import GenerateApiKeyRequest +from src.cudo_compute.models.get_disk_response import GetDiskResponse +from src.cudo_compute.models.get_network_response import GetNetworkResponse +from src.cudo_compute.models.get_object_storage_session_key_response import GetObjectStorageSessionKeyResponse +from src.cudo_compute.models.get_private_vm_image_response import GetPrivateVMImageResponse +from src.cudo_compute.models.get_security_group_response import GetSecurityGroupResponse +from src.cudo_compute.models.get_vm_response import GetVMResponse +from src.cudo_compute.models.gpu_model_category import GpuModelCategory +from src.cudo_compute.models.host_config_category import HostConfigCategory +from src.cudo_compute.models.identity_verification_session import IdentityVerificationSession +from src.cudo_compute.models.image import Image +from src.cudo_compute.models.list_api_keys_response import ListApiKeysResponse +from src.cudo_compute.models.list_disk_snapshots_response import ListDiskSnapshotsResponse +from src.cudo_compute.models.list_disks_response import ListDisksResponse +from src.cudo_compute.models.list_networks_response import ListNetworksResponse +from src.cudo_compute.models.list_object_storage_buckets_response import ListObjectStorageBucketsResponse +from src.cudo_compute.models.list_object_storage_keys_response import ListObjectStorageKeysResponse +from src.cudo_compute.models.list_object_storage_users_response import ListObjectStorageUsersResponse +from src.cudo_compute.models.list_private_vm_images_response import ListPrivateVMImagesResponse +from src.cudo_compute.models.list_private_vm_images_response_private_image import ListPrivateVMImagesResponsePrivateImage +from src.cudo_compute.models.list_project_ssh_keys_response import ListProjectSshKeysResponse +from src.cudo_compute.models.list_projects_response import ListProjectsResponse +from src.cudo_compute.models.list_public_vm_images_response import ListPublicVMImagesResponse +from src.cudo_compute.models.list_regions_response import ListRegionsResponse +from src.cudo_compute.models.list_security_groups_response import ListSecurityGroupsResponse +from src.cudo_compute.models.list_ssh_keys_response import ListSshKeysResponse +from src.cudo_compute.models.list_user_permissions_response import ListUserPermissionsResponse +from src.cudo_compute.models.list_vm_data_centers_response import ListVMDataCentersResponse +from src.cudo_compute.models.list_vm_disks_response import ListVMDisksResponse +from src.cudo_compute.models.list_vm_machine_types_request import ListVMMachineTypesRequest +from src.cudo_compute.models.list_vm_machine_types_response import ListVMMachineTypesResponse +from src.cudo_compute.models.list_vms_response import ListVMsResponse +from src.cudo_compute.models.monitor_vm_response import MonitorVMResponse +from src.cudo_compute.models.network import Network +from src.cudo_compute.models.network_price_hr import NetworkPriceHr +from src.cudo_compute.models.object_storage_bucket import ObjectStorageBucket +from src.cudo_compute.models.object_storage_key import ObjectStorageKey +from src.cudo_compute.models.object_storage_user import ObjectStorageUser +from src.cudo_compute.models.profile import Profile +from src.cudo_compute.models.project import Project +from src.cudo_compute.models.protocol import Protocol +from src.cudo_compute.models.reboot_vm_response import RebootVMResponse +from src.cudo_compute.models.region import Region +from src.cudo_compute.models.resize_vm_disk_response import ResizeVMDiskResponse +from src.cudo_compute.models.resize_vm_response import ResizeVMResponse +from src.cudo_compute.models.revert_disk_response import RevertDiskResponse +from src.cudo_compute.models.role import Role +from src.cudo_compute.models.rule import Rule +from src.cudo_compute.models.rule_type import RuleType +from src.cudo_compute.models.security_group import SecurityGroup +from src.cudo_compute.models.security_group1 import SecurityGroup1 +from src.cudo_compute.models.security_group_rule import SecurityGroupRule +from src.cudo_compute.models.snapshot import Snapshot +from src.cudo_compute.models.ssh_key import SshKey +from src.cudo_compute.models.ssh_key_source import SshKeySource +from src.cudo_compute.models.start_network_response import StartNetworkResponse +from src.cudo_compute.models.start_vm_response import StartVMResponse +from src.cudo_compute.models.status import Status +from src.cudo_compute.models.stop_network_response import StopNetworkResponse +from src.cudo_compute.models.stop_vm_response import StopVMResponse +from src.cudo_compute.models.terminate_vm_response import TerminateVMResponse +from src.cudo_compute.models.update_private_vm_image_response import UpdatePrivateVMImageResponse +from src.cudo_compute.models.update_security_group_response import UpdateSecurityGroupResponse +from src.cudo_compute.models.user_permission import UserPermission +from src.cudo_compute.models.v1_private_image import V1PrivateImage +from src.cudo_compute.models.vm import VM +from src.cudo_compute.models.vm_data_center import VMDataCenter +from src.cudo_compute.models.vm_data_center_storage_class import VMDataCenterStorageClass +from src.cudo_compute.models.vm_monitoring_item import VMMonitoringItem +from src.cudo_compute.models.vmnic import VMNIC +from src.cudo_compute.models.v_router_size import VRouterSize diff --git a/src/cudo_compute/models/any.py b/src/cudo_compute/models/any.py new file mode 100644 index 0000000..27c9563 --- /dev/null +++ b/src/cudo_compute/models/any.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Any(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'type': 'str' + } + + attribute_map = { + 'type': '@type' + } + + def __init__(self, type=None, _configuration=None): # noqa: E501 + """Any - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._type = None + self.discriminator = None + + if type is not None: + self.type = type + + @property + def type(self): + """Gets the type of this Any. # noqa: E501 + + + :return: The type of this Any. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Any. + + + :param type: The type of this Any. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Any, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Any): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Any): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/api_key.py b/src/cudo_compute/models/api_key.py new file mode 100644 index 0000000..8484289 --- /dev/null +++ b/src/cudo_compute/models/api_key.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ApiKey(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'create_time': 'datetime', + 'id': 'str', + 'key': 'str' + } + + attribute_map = { + 'create_time': 'createTime', + 'id': 'id', + 'key': 'key' + } + + def __init__(self, create_time=None, id=None, key=None, _configuration=None): # noqa: E501 + """ApiKey - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._create_time = None + self._id = None + self._key = None + self.discriminator = None + + if create_time is not None: + self.create_time = create_time + if id is not None: + self.id = id + if key is not None: + self.key = key + + @property + def create_time(self): + """Gets the create_time of this ApiKey. # noqa: E501 + + + :return: The create_time of this ApiKey. # noqa: E501 + :rtype: datetime + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this ApiKey. + + + :param create_time: The create_time of this ApiKey. # noqa: E501 + :type: datetime + """ + + self._create_time = create_time + + @property + def id(self): + """Gets the id of this ApiKey. # noqa: E501 + + + :return: The id of this ApiKey. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ApiKey. + + + :param id: The id of this ApiKey. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def key(self): + """Gets the key of this ApiKey. # noqa: E501 + + + :return: The key of this ApiKey. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this ApiKey. + + + :param key: The key of this ApiKey. # noqa: E501 + :type: str + """ + + self._key = key + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ApiKey, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiKey): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiKey): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/attach_storage_disk_response.py b/src/cudo_compute/models/attach_storage_disk_response.py new file mode 100644 index 0000000..bd8f1f2 --- /dev/null +++ b/src/cudo_compute/models/attach_storage_disk_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class AttachStorageDiskResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """AttachStorageDiskResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AttachStorageDiskResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AttachStorageDiskResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AttachStorageDiskResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/body.py b/src/cudo_compute/models/body.py new file mode 100644 index 0000000..7f148de --- /dev/null +++ b/src/cudo_compute/models/body.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Body(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data_center_id': 'str', + 'project_id': 'str', + 'role': 'Role', + 'user_email': 'str' + } + + attribute_map = { + 'data_center_id': 'dataCenterId', + 'project_id': 'projectId', + 'role': 'role', + 'user_email': 'userEmail' + } + + def __init__(self, data_center_id=None, project_id=None, role=None, user_email=None, _configuration=None): # noqa: E501 + """Body - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._data_center_id = None + self._project_id = None + self._role = None + self._user_email = None + self.discriminator = None + + if data_center_id is not None: + self.data_center_id = data_center_id + if project_id is not None: + self.project_id = project_id + self.role = role + self.user_email = user_email + + @property + def data_center_id(self): + """Gets the data_center_id of this Body. # noqa: E501 + + + :return: The data_center_id of this Body. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this Body. + + + :param data_center_id: The data_center_id of this Body. # noqa: E501 + :type: str + """ + + self._data_center_id = data_center_id + + @property + def project_id(self): + """Gets the project_id of this Body. # noqa: E501 + + + :return: The project_id of this Body. # noqa: E501 + :rtype: str + """ + return self._project_id + + @project_id.setter + def project_id(self, project_id): + """Sets the project_id of this Body. + + + :param project_id: The project_id of this Body. # noqa: E501 + :type: str + """ + + self._project_id = project_id + + @property + def role(self): + """Gets the role of this Body. # noqa: E501 + + + :return: The role of this Body. # noqa: E501 + :rtype: Role + """ + return self._role + + @role.setter + def role(self, role): + """Sets the role of this Body. + + + :param role: The role of this Body. # noqa: E501 + :type: Role + """ + if self._configuration.client_side_validation and role is None: + raise ValueError("Invalid value for `role`, must not be `None`") # noqa: E501 + + self._role = role + + @property + def user_email(self): + """Gets the user_email of this Body. # noqa: E501 + + + :return: The user_email of this Body. # noqa: E501 + :rtype: str + """ + return self._user_email + + @user_email.setter + def user_email(self, user_email): + """Sets the user_email of this Body. + + + :param user_email: The user_email of this Body. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and user_email is None: + raise ValueError("Invalid value for `user_email`, must not be `None`") # noqa: E501 + + self._user_email = user_email + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Body): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/body1.py b/src/cudo_compute/models/body1.py new file mode 100644 index 0000000..91e9bb2 --- /dev/null +++ b/src/cudo_compute/models/body1.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Body1(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data_center_id': 'str', + 'project_id': 'str', + 'role': 'Role', + 'user_id': 'str' + } + + attribute_map = { + 'data_center_id': 'dataCenterId', + 'project_id': 'projectId', + 'role': 'role', + 'user_id': 'userId' + } + + def __init__(self, data_center_id=None, project_id=None, role=None, user_id=None, _configuration=None): # noqa: E501 + """Body1 - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._data_center_id = None + self._project_id = None + self._role = None + self._user_id = None + self.discriminator = None + + if data_center_id is not None: + self.data_center_id = data_center_id + if project_id is not None: + self.project_id = project_id + self.role = role + self.user_id = user_id + + @property + def data_center_id(self): + """Gets the data_center_id of this Body1. # noqa: E501 + + + :return: The data_center_id of this Body1. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this Body1. + + + :param data_center_id: The data_center_id of this Body1. # noqa: E501 + :type: str + """ + + self._data_center_id = data_center_id + + @property + def project_id(self): + """Gets the project_id of this Body1. # noqa: E501 + + + :return: The project_id of this Body1. # noqa: E501 + :rtype: str + """ + return self._project_id + + @project_id.setter + def project_id(self, project_id): + """Sets the project_id of this Body1. + + + :param project_id: The project_id of this Body1. # noqa: E501 + :type: str + """ + + self._project_id = project_id + + @property + def role(self): + """Gets the role of this Body1. # noqa: E501 + + + :return: The role of this Body1. # noqa: E501 + :rtype: Role + """ + return self._role + + @role.setter + def role(self, role): + """Sets the role of this Body1. + + + :param role: The role of this Body1. # noqa: E501 + :type: Role + """ + if self._configuration.client_side_validation and role is None: + raise ValueError("Invalid value for `role`, must not be `None`") # noqa: E501 + + self._role = role + + @property + def user_id(self): + """Gets the user_id of this Body1. # noqa: E501 + + + :return: The user_id of this Body1. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this Body1. + + + :param user_id: The user_id of this Body1. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and user_id is None: + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body1, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body1): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Body1): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/body10.py b/src/cudo_compute/models/body10.py new file mode 100644 index 0000000..f12aa25 --- /dev/null +++ b/src/cudo_compute/models/body10.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Body10(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'billing_account_id': 'str', + 'data_center_id': 'str', + 'role': 'Role', + 'user_id': 'str' + } + + attribute_map = { + 'billing_account_id': 'billingAccountId', + 'data_center_id': 'dataCenterId', + 'role': 'role', + 'user_id': 'userId' + } + + def __init__(self, billing_account_id=None, data_center_id=None, role=None, user_id=None, _configuration=None): # noqa: E501 + """Body10 - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._billing_account_id = None + self._data_center_id = None + self._role = None + self._user_id = None + self.discriminator = None + + if billing_account_id is not None: + self.billing_account_id = billing_account_id + if data_center_id is not None: + self.data_center_id = data_center_id + self.role = role + self.user_id = user_id + + @property + def billing_account_id(self): + """Gets the billing_account_id of this Body10. # noqa: E501 + + + :return: The billing_account_id of this Body10. # noqa: E501 + :rtype: str + """ + return self._billing_account_id + + @billing_account_id.setter + def billing_account_id(self, billing_account_id): + """Sets the billing_account_id of this Body10. + + + :param billing_account_id: The billing_account_id of this Body10. # noqa: E501 + :type: str + """ + + self._billing_account_id = billing_account_id + + @property + def data_center_id(self): + """Gets the data_center_id of this Body10. # noqa: E501 + + + :return: The data_center_id of this Body10. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this Body10. + + + :param data_center_id: The data_center_id of this Body10. # noqa: E501 + :type: str + """ + + self._data_center_id = data_center_id + + @property + def role(self): + """Gets the role of this Body10. # noqa: E501 + + + :return: The role of this Body10. # noqa: E501 + :rtype: Role + """ + return self._role + + @role.setter + def role(self, role): + """Sets the role of this Body10. + + + :param role: The role of this Body10. # noqa: E501 + :type: Role + """ + if self._configuration.client_side_validation and role is None: + raise ValueError("Invalid value for `role`, must not be `None`") # noqa: E501 + + self._role = role + + @property + def user_id(self): + """Gets the user_id of this Body10. # noqa: E501 + + + :return: The user_id of this Body10. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this Body10. + + + :param user_id: The user_id of this Body10. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and user_id is None: + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body10, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body10): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Body10): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/body11.py b/src/cudo_compute/models/body11.py new file mode 100644 index 0000000..f0cfd3f --- /dev/null +++ b/src/cudo_compute/models/body11.py @@ -0,0 +1,593 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Body11(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'boot_disk': 'Disk', + 'boot_disk_image_id': 'str', + 'cpu_model': 'str', + 'custom_ssh_keys': 'list[str]', + 'data_center_id': 'str', + 'gpu_model': 'str', + 'gpus': 'int', + 'machine_type': 'str', + 'max_price_hr': 'Decimal', + 'memory_gib': 'int', + 'metadata': 'dict(str, str)', + 'nics': 'list[CreateVMRequestNIC]', + 'password': 'str', + 'security_group_ids': 'list[str]', + 'ssh_key_source': 'SshKeySource', + 'start_script': 'str', + 'storage_disk_ids': 'list[str]', + 'vcpus': 'int', + 'vm_id': 'str' + } + + attribute_map = { + 'boot_disk': 'bootDisk', + 'boot_disk_image_id': 'bootDiskImageId', + 'cpu_model': 'cpuModel', + 'custom_ssh_keys': 'customSshKeys', + 'data_center_id': 'dataCenterId', + 'gpu_model': 'gpuModel', + 'gpus': 'gpus', + 'machine_type': 'machineType', + 'max_price_hr': 'maxPriceHr', + 'memory_gib': 'memoryGib', + 'metadata': 'metadata', + 'nics': 'nics', + 'password': 'password', + 'security_group_ids': 'securityGroupIds', + 'ssh_key_source': 'sshKeySource', + 'start_script': 'startScript', + 'storage_disk_ids': 'storageDiskIds', + 'vcpus': 'vcpus', + 'vm_id': 'vmId' + } + + def __init__(self, boot_disk=None, boot_disk_image_id=None, cpu_model=None, custom_ssh_keys=None, data_center_id=None, gpu_model=None, gpus=None, machine_type=None, max_price_hr=None, memory_gib=None, metadata=None, nics=None, password=None, security_group_ids=None, ssh_key_source=None, start_script=None, storage_disk_ids=None, vcpus=None, vm_id=None, _configuration=None): # noqa: E501 + """Body11 - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._boot_disk = None + self._boot_disk_image_id = None + self._cpu_model = None + self._custom_ssh_keys = None + self._data_center_id = None + self._gpu_model = None + self._gpus = None + self._machine_type = None + self._max_price_hr = None + self._memory_gib = None + self._metadata = None + self._nics = None + self._password = None + self._security_group_ids = None + self._ssh_key_source = None + self._start_script = None + self._storage_disk_ids = None + self._vcpus = None + self._vm_id = None + self.discriminator = None + + if boot_disk is not None: + self.boot_disk = boot_disk + self.boot_disk_image_id = boot_disk_image_id + if cpu_model is not None: + self.cpu_model = cpu_model + if custom_ssh_keys is not None: + self.custom_ssh_keys = custom_ssh_keys + if data_center_id is not None: + self.data_center_id = data_center_id + if gpu_model is not None: + self.gpu_model = gpu_model + if gpus is not None: + self.gpus = gpus + if machine_type is not None: + self.machine_type = machine_type + if max_price_hr is not None: + self.max_price_hr = max_price_hr + if memory_gib is not None: + self.memory_gib = memory_gib + if metadata is not None: + self.metadata = metadata + if nics is not None: + self.nics = nics + if password is not None: + self.password = password + if security_group_ids is not None: + self.security_group_ids = security_group_ids + if ssh_key_source is not None: + self.ssh_key_source = ssh_key_source + if start_script is not None: + self.start_script = start_script + if storage_disk_ids is not None: + self.storage_disk_ids = storage_disk_ids + if vcpus is not None: + self.vcpus = vcpus + self.vm_id = vm_id + + @property + def boot_disk(self): + """Gets the boot_disk of this Body11. # noqa: E501 + + + :return: The boot_disk of this Body11. # noqa: E501 + :rtype: Disk + """ + return self._boot_disk + + @boot_disk.setter + def boot_disk(self, boot_disk): + """Sets the boot_disk of this Body11. + + + :param boot_disk: The boot_disk of this Body11. # noqa: E501 + :type: Disk + """ + + self._boot_disk = boot_disk + + @property + def boot_disk_image_id(self): + """Gets the boot_disk_image_id of this Body11. # noqa: E501 + + + :return: The boot_disk_image_id of this Body11. # noqa: E501 + :rtype: str + """ + return self._boot_disk_image_id + + @boot_disk_image_id.setter + def boot_disk_image_id(self, boot_disk_image_id): + """Sets the boot_disk_image_id of this Body11. + + + :param boot_disk_image_id: The boot_disk_image_id of this Body11. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and boot_disk_image_id is None: + raise ValueError("Invalid value for `boot_disk_image_id`, must not be `None`") # noqa: E501 + + self._boot_disk_image_id = boot_disk_image_id + + @property + def cpu_model(self): + """Gets the cpu_model of this Body11. # noqa: E501 + + + :return: The cpu_model of this Body11. # noqa: E501 + :rtype: str + """ + return self._cpu_model + + @cpu_model.setter + def cpu_model(self, cpu_model): + """Sets the cpu_model of this Body11. + + + :param cpu_model: The cpu_model of this Body11. # noqa: E501 + :type: str + """ + + self._cpu_model = cpu_model + + @property + def custom_ssh_keys(self): + """Gets the custom_ssh_keys of this Body11. # noqa: E501 + + + :return: The custom_ssh_keys of this Body11. # noqa: E501 + :rtype: list[str] + """ + return self._custom_ssh_keys + + @custom_ssh_keys.setter + def custom_ssh_keys(self, custom_ssh_keys): + """Sets the custom_ssh_keys of this Body11. + + + :param custom_ssh_keys: The custom_ssh_keys of this Body11. # noqa: E501 + :type: list[str] + """ + + self._custom_ssh_keys = custom_ssh_keys + + @property + def data_center_id(self): + """Gets the data_center_id of this Body11. # noqa: E501 + + + :return: The data_center_id of this Body11. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this Body11. + + + :param data_center_id: The data_center_id of this Body11. # noqa: E501 + :type: str + """ + + self._data_center_id = data_center_id + + @property + def gpu_model(self): + """Gets the gpu_model of this Body11. # noqa: E501 + + + :return: The gpu_model of this Body11. # noqa: E501 + :rtype: str + """ + return self._gpu_model + + @gpu_model.setter + def gpu_model(self, gpu_model): + """Sets the gpu_model of this Body11. + + + :param gpu_model: The gpu_model of this Body11. # noqa: E501 + :type: str + """ + + self._gpu_model = gpu_model + + @property + def gpus(self): + """Gets the gpus of this Body11. # noqa: E501 + + + :return: The gpus of this Body11. # noqa: E501 + :rtype: int + """ + return self._gpus + + @gpus.setter + def gpus(self, gpus): + """Sets the gpus of this Body11. + + + :param gpus: The gpus of this Body11. # noqa: E501 + :type: int + """ + + self._gpus = gpus + + @property + def machine_type(self): + """Gets the machine_type of this Body11. # noqa: E501 + + + :return: The machine_type of this Body11. # noqa: E501 + :rtype: str + """ + return self._machine_type + + @machine_type.setter + def machine_type(self, machine_type): + """Sets the machine_type of this Body11. + + + :param machine_type: The machine_type of this Body11. # noqa: E501 + :type: str + """ + + self._machine_type = machine_type + + @property + def max_price_hr(self): + """Gets the max_price_hr of this Body11. # noqa: E501 + + + :return: The max_price_hr of this Body11. # noqa: E501 + :rtype: Decimal + """ + return self._max_price_hr + + @max_price_hr.setter + def max_price_hr(self, max_price_hr): + """Sets the max_price_hr of this Body11. + + + :param max_price_hr: The max_price_hr of this Body11. # noqa: E501 + :type: Decimal + """ + + self._max_price_hr = max_price_hr + + @property + def memory_gib(self): + """Gets the memory_gib of this Body11. # noqa: E501 + + + :return: The memory_gib of this Body11. # noqa: E501 + :rtype: int + """ + return self._memory_gib + + @memory_gib.setter + def memory_gib(self, memory_gib): + """Sets the memory_gib of this Body11. + + + :param memory_gib: The memory_gib of this Body11. # noqa: E501 + :type: int + """ + + self._memory_gib = memory_gib + + @property + def metadata(self): + """Gets the metadata of this Body11. # noqa: E501 + + + :return: The metadata of this Body11. # noqa: E501 + :rtype: dict(str, str) + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this Body11. + + + :param metadata: The metadata of this Body11. # noqa: E501 + :type: dict(str, str) + """ + + self._metadata = metadata + + @property + def nics(self): + """Gets the nics of this Body11. # noqa: E501 + + + :return: The nics of this Body11. # noqa: E501 + :rtype: list[CreateVMRequestNIC] + """ + return self._nics + + @nics.setter + def nics(self, nics): + """Sets the nics of this Body11. + + + :param nics: The nics of this Body11. # noqa: E501 + :type: list[CreateVMRequestNIC] + """ + + self._nics = nics + + @property + def password(self): + """Gets the password of this Body11. # noqa: E501 + + + :return: The password of this Body11. # noqa: E501 + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """Sets the password of this Body11. + + + :param password: The password of this Body11. # noqa: E501 + :type: str + """ + + self._password = password + + @property + def security_group_ids(self): + """Gets the security_group_ids of this Body11. # noqa: E501 + + + :return: The security_group_ids of this Body11. # noqa: E501 + :rtype: list[str] + """ + return self._security_group_ids + + @security_group_ids.setter + def security_group_ids(self, security_group_ids): + """Sets the security_group_ids of this Body11. + + + :param security_group_ids: The security_group_ids of this Body11. # noqa: E501 + :type: list[str] + """ + + self._security_group_ids = security_group_ids + + @property + def ssh_key_source(self): + """Gets the ssh_key_source of this Body11. # noqa: E501 + + + :return: The ssh_key_source of this Body11. # noqa: E501 + :rtype: SshKeySource + """ + return self._ssh_key_source + + @ssh_key_source.setter + def ssh_key_source(self, ssh_key_source): + """Sets the ssh_key_source of this Body11. + + + :param ssh_key_source: The ssh_key_source of this Body11. # noqa: E501 + :type: SshKeySource + """ + + self._ssh_key_source = ssh_key_source + + @property + def start_script(self): + """Gets the start_script of this Body11. # noqa: E501 + + + :return: The start_script of this Body11. # noqa: E501 + :rtype: str + """ + return self._start_script + + @start_script.setter + def start_script(self, start_script): + """Sets the start_script of this Body11. + + + :param start_script: The start_script of this Body11. # noqa: E501 + :type: str + """ + + self._start_script = start_script + + @property + def storage_disk_ids(self): + """Gets the storage_disk_ids of this Body11. # noqa: E501 + + + :return: The storage_disk_ids of this Body11. # noqa: E501 + :rtype: list[str] + """ + return self._storage_disk_ids + + @storage_disk_ids.setter + def storage_disk_ids(self, storage_disk_ids): + """Sets the storage_disk_ids of this Body11. + + + :param storage_disk_ids: The storage_disk_ids of this Body11. # noqa: E501 + :type: list[str] + """ + + self._storage_disk_ids = storage_disk_ids + + @property + def vcpus(self): + """Gets the vcpus of this Body11. # noqa: E501 + + + :return: The vcpus of this Body11. # noqa: E501 + :rtype: int + """ + return self._vcpus + + @vcpus.setter + def vcpus(self, vcpus): + """Sets the vcpus of this Body11. + + + :param vcpus: The vcpus of this Body11. # noqa: E501 + :type: int + """ + + self._vcpus = vcpus + + @property + def vm_id(self): + """Gets the vm_id of this Body11. # noqa: E501 + + + :return: The vm_id of this Body11. # noqa: E501 + :rtype: str + """ + return self._vm_id + + @vm_id.setter + def vm_id(self, vm_id): + """Sets the vm_id of this Body11. + + + :param vm_id: The vm_id of this Body11. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and vm_id is None: + raise ValueError("Invalid value for `vm_id`, must not be `None`") # noqa: E501 + + self._vm_id = vm_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body11, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body11): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Body11): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/body2.py b/src/cudo_compute/models/body2.py new file mode 100644 index 0000000..5879070 --- /dev/null +++ b/src/cudo_compute/models/body2.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Body2(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'billing_account_id': 'str', + 'project_id': 'str', + 'role': 'Role', + 'user_email': 'str' + } + + attribute_map = { + 'billing_account_id': 'billingAccountId', + 'project_id': 'projectId', + 'role': 'role', + 'user_email': 'userEmail' + } + + def __init__(self, billing_account_id=None, project_id=None, role=None, user_email=None, _configuration=None): # noqa: E501 + """Body2 - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._billing_account_id = None + self._project_id = None + self._role = None + self._user_email = None + self.discriminator = None + + if billing_account_id is not None: + self.billing_account_id = billing_account_id + if project_id is not None: + self.project_id = project_id + self.role = role + self.user_email = user_email + + @property + def billing_account_id(self): + """Gets the billing_account_id of this Body2. # noqa: E501 + + + :return: The billing_account_id of this Body2. # noqa: E501 + :rtype: str + """ + return self._billing_account_id + + @billing_account_id.setter + def billing_account_id(self, billing_account_id): + """Sets the billing_account_id of this Body2. + + + :param billing_account_id: The billing_account_id of this Body2. # noqa: E501 + :type: str + """ + + self._billing_account_id = billing_account_id + + @property + def project_id(self): + """Gets the project_id of this Body2. # noqa: E501 + + + :return: The project_id of this Body2. # noqa: E501 + :rtype: str + """ + return self._project_id + + @project_id.setter + def project_id(self, project_id): + """Sets the project_id of this Body2. + + + :param project_id: The project_id of this Body2. # noqa: E501 + :type: str + """ + + self._project_id = project_id + + @property + def role(self): + """Gets the role of this Body2. # noqa: E501 + + + :return: The role of this Body2. # noqa: E501 + :rtype: Role + """ + return self._role + + @role.setter + def role(self, role): + """Sets the role of this Body2. + + + :param role: The role of this Body2. # noqa: E501 + :type: Role + """ + if self._configuration.client_side_validation and role is None: + raise ValueError("Invalid value for `role`, must not be `None`") # noqa: E501 + + self._role = role + + @property + def user_email(self): + """Gets the user_email of this Body2. # noqa: E501 + + + :return: The user_email of this Body2. # noqa: E501 + :rtype: str + """ + return self._user_email + + @user_email.setter + def user_email(self, user_email): + """Sets the user_email of this Body2. + + + :param user_email: The user_email of this Body2. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and user_email is None: + raise ValueError("Invalid value for `user_email`, must not be `None`") # noqa: E501 + + self._user_email = user_email + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body2, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body2): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Body2): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/body3.py b/src/cudo_compute/models/body3.py new file mode 100644 index 0000000..d33405f --- /dev/null +++ b/src/cudo_compute/models/body3.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Body3(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'billing_account_id': 'str', + 'project_id': 'str', + 'role': 'Role', + 'user_id': 'str' + } + + attribute_map = { + 'billing_account_id': 'billingAccountId', + 'project_id': 'projectId', + 'role': 'role', + 'user_id': 'userId' + } + + def __init__(self, billing_account_id=None, project_id=None, role=None, user_id=None, _configuration=None): # noqa: E501 + """Body3 - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._billing_account_id = None + self._project_id = None + self._role = None + self._user_id = None + self.discriminator = None + + if billing_account_id is not None: + self.billing_account_id = billing_account_id + if project_id is not None: + self.project_id = project_id + self.role = role + self.user_id = user_id + + @property + def billing_account_id(self): + """Gets the billing_account_id of this Body3. # noqa: E501 + + + :return: The billing_account_id of this Body3. # noqa: E501 + :rtype: str + """ + return self._billing_account_id + + @billing_account_id.setter + def billing_account_id(self, billing_account_id): + """Sets the billing_account_id of this Body3. + + + :param billing_account_id: The billing_account_id of this Body3. # noqa: E501 + :type: str + """ + + self._billing_account_id = billing_account_id + + @property + def project_id(self): + """Gets the project_id of this Body3. # noqa: E501 + + + :return: The project_id of this Body3. # noqa: E501 + :rtype: str + """ + return self._project_id + + @project_id.setter + def project_id(self, project_id): + """Sets the project_id of this Body3. + + + :param project_id: The project_id of this Body3. # noqa: E501 + :type: str + """ + + self._project_id = project_id + + @property + def role(self): + """Gets the role of this Body3. # noqa: E501 + + + :return: The role of this Body3. # noqa: E501 + :rtype: Role + """ + return self._role + + @role.setter + def role(self, role): + """Sets the role of this Body3. + + + :param role: The role of this Body3. # noqa: E501 + :type: Role + """ + if self._configuration.client_side_validation and role is None: + raise ValueError("Invalid value for `role`, must not be `None`") # noqa: E501 + + self._role = role + + @property + def user_id(self): + """Gets the user_id of this Body3. # noqa: E501 + + + :return: The user_id of this Body3. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this Body3. + + + :param user_id: The user_id of this Body3. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and user_id is None: + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body3, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body3): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Body3): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/body4.py b/src/cudo_compute/models/body4.py new file mode 100644 index 0000000..db39eb1 --- /dev/null +++ b/src/cudo_compute/models/body4.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Body4(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'billing_account_id': 'str', + 'data_center_id': 'str', + 'role': 'Role', + 'user_email': 'str' + } + + attribute_map = { + 'billing_account_id': 'billingAccountId', + 'data_center_id': 'dataCenterId', + 'role': 'role', + 'user_email': 'userEmail' + } + + def __init__(self, billing_account_id=None, data_center_id=None, role=None, user_email=None, _configuration=None): # noqa: E501 + """Body4 - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._billing_account_id = None + self._data_center_id = None + self._role = None + self._user_email = None + self.discriminator = None + + if billing_account_id is not None: + self.billing_account_id = billing_account_id + if data_center_id is not None: + self.data_center_id = data_center_id + self.role = role + self.user_email = user_email + + @property + def billing_account_id(self): + """Gets the billing_account_id of this Body4. # noqa: E501 + + + :return: The billing_account_id of this Body4. # noqa: E501 + :rtype: str + """ + return self._billing_account_id + + @billing_account_id.setter + def billing_account_id(self, billing_account_id): + """Sets the billing_account_id of this Body4. + + + :param billing_account_id: The billing_account_id of this Body4. # noqa: E501 + :type: str + """ + + self._billing_account_id = billing_account_id + + @property + def data_center_id(self): + """Gets the data_center_id of this Body4. # noqa: E501 + + + :return: The data_center_id of this Body4. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this Body4. + + + :param data_center_id: The data_center_id of this Body4. # noqa: E501 + :type: str + """ + + self._data_center_id = data_center_id + + @property + def role(self): + """Gets the role of this Body4. # noqa: E501 + + + :return: The role of this Body4. # noqa: E501 + :rtype: Role + """ + return self._role + + @role.setter + def role(self, role): + """Sets the role of this Body4. + + + :param role: The role of this Body4. # noqa: E501 + :type: Role + """ + if self._configuration.client_side_validation and role is None: + raise ValueError("Invalid value for `role`, must not be `None`") # noqa: E501 + + self._role = role + + @property + def user_email(self): + """Gets the user_email of this Body4. # noqa: E501 + + + :return: The user_email of this Body4. # noqa: E501 + :rtype: str + """ + return self._user_email + + @user_email.setter + def user_email(self, user_email): + """Sets the user_email of this Body4. + + + :param user_email: The user_email of this Body4. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and user_email is None: + raise ValueError("Invalid value for `user_email`, must not be `None`") # noqa: E501 + + self._user_email = user_email + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body4, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body4): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Body4): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/body5.py b/src/cudo_compute/models/body5.py new file mode 100644 index 0000000..f4a762f --- /dev/null +++ b/src/cudo_compute/models/body5.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Body5(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data_center_id': 'str', + 'disk': 'Disk' + } + + attribute_map = { + 'data_center_id': 'dataCenterId', + 'disk': 'disk' + } + + def __init__(self, data_center_id=None, disk=None, _configuration=None): # noqa: E501 + """Body5 - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._data_center_id = None + self._disk = None + self.discriminator = None + + if data_center_id is not None: + self.data_center_id = data_center_id + if disk is not None: + self.disk = disk + + @property + def data_center_id(self): + """Gets the data_center_id of this Body5. # noqa: E501 + + + :return: The data_center_id of this Body5. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this Body5. + + + :param data_center_id: The data_center_id of this Body5. # noqa: E501 + :type: str + """ + + self._data_center_id = data_center_id + + @property + def disk(self): + """Gets the disk of this Body5. # noqa: E501 + + + :return: The disk of this Body5. # noqa: E501 + :rtype: Disk + """ + return self._disk + + @disk.setter + def disk(self, disk): + """Sets the disk of this Body5. + + + :param disk: The disk of this Body5. # noqa: E501 + :type: Disk + """ + + self._disk = disk + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body5, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body5): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Body5): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/body6.py b/src/cudo_compute/models/body6.py new file mode 100644 index 0000000..17679b6 --- /dev/null +++ b/src/cudo_compute/models/body6.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Body6(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'snapshot_id': 'str', + 'vm_id': 'str' + } + + attribute_map = { + 'snapshot_id': 'snapshotId', + 'vm_id': 'vmId' + } + + def __init__(self, snapshot_id=None, vm_id=None, _configuration=None): # noqa: E501 + """Body6 - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._snapshot_id = None + self._vm_id = None + self.discriminator = None + + self.snapshot_id = snapshot_id + self.vm_id = vm_id + + @property + def snapshot_id(self): + """Gets the snapshot_id of this Body6. # noqa: E501 + + + :return: The snapshot_id of this Body6. # noqa: E501 + :rtype: str + """ + return self._snapshot_id + + @snapshot_id.setter + def snapshot_id(self, snapshot_id): + """Sets the snapshot_id of this Body6. + + + :param snapshot_id: The snapshot_id of this Body6. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and snapshot_id is None: + raise ValueError("Invalid value for `snapshot_id`, must not be `None`") # noqa: E501 + + self._snapshot_id = snapshot_id + + @property + def vm_id(self): + """Gets the vm_id of this Body6. # noqa: E501 + + + :return: The vm_id of this Body6. # noqa: E501 + :rtype: str + """ + return self._vm_id + + @vm_id.setter + def vm_id(self, vm_id): + """Sets the vm_id of this Body6. + + + :param vm_id: The vm_id of this Body6. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and vm_id is None: + raise ValueError("Invalid value for `vm_id`, must not be `None`") # noqa: E501 + + self._vm_id = vm_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body6, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body6): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Body6): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/body7.py b/src/cudo_compute/models/body7.py new file mode 100644 index 0000000..d7e2621 --- /dev/null +++ b/src/cudo_compute/models/body7.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Body7(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'cidr_prefix': 'str', + 'data_center_id': 'str', + 'id': 'str', + 'network_id': 'str', + 'vrouter_size': 'VRouterSize' + } + + attribute_map = { + 'cidr_prefix': 'cidrPrefix', + 'data_center_id': 'dataCenterId', + 'id': 'id', + 'network_id': 'networkId', + 'vrouter_size': 'vrouterSize' + } + + def __init__(self, cidr_prefix=None, data_center_id=None, id=None, network_id=None, vrouter_size=None, _configuration=None): # noqa: E501 + """Body7 - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._cidr_prefix = None + self._data_center_id = None + self._id = None + self._network_id = None + self._vrouter_size = None + self.discriminator = None + + self.cidr_prefix = cidr_prefix + self.data_center_id = data_center_id + self.id = id + self.network_id = network_id + if vrouter_size is not None: + self.vrouter_size = vrouter_size + + @property + def cidr_prefix(self): + """Gets the cidr_prefix of this Body7. # noqa: E501 + + + :return: The cidr_prefix of this Body7. # noqa: E501 + :rtype: str + """ + return self._cidr_prefix + + @cidr_prefix.setter + def cidr_prefix(self, cidr_prefix): + """Sets the cidr_prefix of this Body7. + + + :param cidr_prefix: The cidr_prefix of this Body7. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and cidr_prefix is None: + raise ValueError("Invalid value for `cidr_prefix`, must not be `None`") # noqa: E501 + + self._cidr_prefix = cidr_prefix + + @property + def data_center_id(self): + """Gets the data_center_id of this Body7. # noqa: E501 + + + :return: The data_center_id of this Body7. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this Body7. + + + :param data_center_id: The data_center_id of this Body7. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and data_center_id is None: + raise ValueError("Invalid value for `data_center_id`, must not be `None`") # noqa: E501 + + self._data_center_id = data_center_id + + @property + def id(self): + """Gets the id of this Body7. # noqa: E501 + + + :return: The id of this Body7. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Body7. + + + :param id: The id of this Body7. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def network_id(self): + """Gets the network_id of this Body7. # noqa: E501 + + + :return: The network_id of this Body7. # noqa: E501 + :rtype: str + """ + return self._network_id + + @network_id.setter + def network_id(self, network_id): + """Sets the network_id of this Body7. + + + :param network_id: The network_id of this Body7. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and network_id is None: + raise ValueError("Invalid value for `network_id`, must not be `None`") # noqa: E501 + + self._network_id = network_id + + @property + def vrouter_size(self): + """Gets the vrouter_size of this Body7. # noqa: E501 + + + :return: The vrouter_size of this Body7. # noqa: E501 + :rtype: VRouterSize + """ + return self._vrouter_size + + @vrouter_size.setter + def vrouter_size(self, vrouter_size): + """Sets the vrouter_size of this Body7. + + + :param vrouter_size: The vrouter_size of this Body7. # noqa: E501 + :type: VRouterSize + """ + + self._vrouter_size = vrouter_size + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body7, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body7): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Body7): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/body8.py b/src/cudo_compute/models/body8.py new file mode 100644 index 0000000..3ec0419 --- /dev/null +++ b/src/cudo_compute/models/body8.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Body8(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data_center_id': 'str' + } + + attribute_map = { + 'data_center_id': 'dataCenterId' + } + + def __init__(self, data_center_id=None, _configuration=None): # noqa: E501 + """Body8 - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._data_center_id = None + self.discriminator = None + + if data_center_id is not None: + self.data_center_id = data_center_id + + @property + def data_center_id(self): + """Gets the data_center_id of this Body8. # noqa: E501 + + + :return: The data_center_id of this Body8. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this Body8. + + + :param data_center_id: The data_center_id of this Body8. # noqa: E501 + :type: str + """ + + self._data_center_id = data_center_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body8, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body8): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Body8): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/body9.py b/src/cudo_compute/models/body9.py new file mode 100644 index 0000000..ecd5242 --- /dev/null +++ b/src/cudo_compute/models/body9.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Body9(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str' + } + + attribute_map = { + 'id': 'id' + } + + def __init__(self, id=None, _configuration=None): # noqa: E501 + """Body9 - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._id = None + self.discriminator = None + + if id is not None: + self.id = id + + @property + def id(self): + """Gets the id of this Body9. # noqa: E501 + + + :return: The id of this Body9. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Body9. + + + :param id: The id of this Body9. # noqa: E501 + :type: str + """ + + self._id = id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body9, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body9): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Body9): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/connect_vm_response.py b/src/cudo_compute/models/connect_vm_response.py new file mode 100644 index 0000000..89411b7 --- /dev/null +++ b/src/cudo_compute/models/connect_vm_response.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ConnectVMResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'connect_url': 'str', + 'token': 'str' + } + + attribute_map = { + 'connect_url': 'connectUrl', + 'token': 'token' + } + + def __init__(self, connect_url=None, token=None, _configuration=None): # noqa: E501 + """ConnectVMResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._connect_url = None + self._token = None + self.discriminator = None + + self.connect_url = connect_url + self.token = token + + @property + def connect_url(self): + """Gets the connect_url of this ConnectVMResponse. # noqa: E501 + + + :return: The connect_url of this ConnectVMResponse. # noqa: E501 + :rtype: str + """ + return self._connect_url + + @connect_url.setter + def connect_url(self, connect_url): + """Sets the connect_url of this ConnectVMResponse. + + + :param connect_url: The connect_url of this ConnectVMResponse. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and connect_url is None: + raise ValueError("Invalid value for `connect_url`, must not be `None`") # noqa: E501 + + self._connect_url = connect_url + + @property + def token(self): + """Gets the token of this ConnectVMResponse. # noqa: E501 + + + :return: The token of this ConnectVMResponse. # noqa: E501 + :rtype: str + """ + return self._token + + @token.setter + def token(self, token): + """Sets the token of this ConnectVMResponse. + + + :param token: The token of this ConnectVMResponse. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and token is None: + raise ValueError("Invalid value for `token`, must not be `None`") # noqa: E501 + + self._token = token + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectVMResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectVMResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ConnectVMResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/count_vms_response.py b/src/cudo_compute/models/count_vms_response.py new file mode 100644 index 0000000..bb9d77d --- /dev/null +++ b/src/cudo_compute/models/count_vms_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class CountVMsResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'count': 'int' + } + + attribute_map = { + 'count': 'count' + } + + def __init__(self, count=None, _configuration=None): # noqa: E501 + """CountVMsResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._count = None + self.discriminator = None + + self.count = count + + @property + def count(self): + """Gets the count of this CountVMsResponse. # noqa: E501 + + + :return: The count of this CountVMsResponse. # noqa: E501 + :rtype: int + """ + return self._count + + @count.setter + def count(self, count): + """Sets the count of this CountVMsResponse. + + + :param count: The count of this CountVMsResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and count is None: + raise ValueError("Invalid value for `count`, must not be `None`") # noqa: E501 + + self._count = count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CountVMsResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CountVMsResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CountVMsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/cpu_model_category.py b/src/cudo_compute/models/cpu_model_category.py new file mode 100644 index 0000000..af35136 --- /dev/null +++ b/src/cudo_compute/models/cpu_model_category.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class CpuModelCategory(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'count_vm_available': 'int', + 'min_price_hr': 'Decimal', + 'name': 'str' + } + + attribute_map = { + 'count_vm_available': 'countVmAvailable', + 'min_price_hr': 'minPriceHr', + 'name': 'name' + } + + def __init__(self, count_vm_available=None, min_price_hr=None, name=None, _configuration=None): # noqa: E501 + """CpuModelCategory - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._count_vm_available = None + self._min_price_hr = None + self._name = None + self.discriminator = None + + self.count_vm_available = count_vm_available + self.min_price_hr = min_price_hr + self.name = name + + @property + def count_vm_available(self): + """Gets the count_vm_available of this CpuModelCategory. # noqa: E501 + + + :return: The count_vm_available of this CpuModelCategory. # noqa: E501 + :rtype: int + """ + return self._count_vm_available + + @count_vm_available.setter + def count_vm_available(self, count_vm_available): + """Sets the count_vm_available of this CpuModelCategory. + + + :param count_vm_available: The count_vm_available of this CpuModelCategory. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and count_vm_available is None: + raise ValueError("Invalid value for `count_vm_available`, must not be `None`") # noqa: E501 + + self._count_vm_available = count_vm_available + + @property + def min_price_hr(self): + """Gets the min_price_hr of this CpuModelCategory. # noqa: E501 + + + :return: The min_price_hr of this CpuModelCategory. # noqa: E501 + :rtype: Decimal + """ + return self._min_price_hr + + @min_price_hr.setter + def min_price_hr(self, min_price_hr): + """Sets the min_price_hr of this CpuModelCategory. + + + :param min_price_hr: The min_price_hr of this CpuModelCategory. # noqa: E501 + :type: Decimal + """ + if self._configuration.client_side_validation and min_price_hr is None: + raise ValueError("Invalid value for `min_price_hr`, must not be `None`") # noqa: E501 + + self._min_price_hr = min_price_hr + + @property + def name(self): + """Gets the name of this CpuModelCategory. # noqa: E501 + + + :return: The name of this CpuModelCategory. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CpuModelCategory. + + + :param name: The name of this CpuModelCategory. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CpuModelCategory, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CpuModelCategory): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CpuModelCategory): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/create_disk_snapshot_response.py b/src/cudo_compute/models/create_disk_snapshot_response.py new file mode 100644 index 0000000..b0ba9bd --- /dev/null +++ b/src/cudo_compute/models/create_disk_snapshot_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class CreateDiskSnapshotResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """CreateDiskSnapshotResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CreateDiskSnapshotResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateDiskSnapshotResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateDiskSnapshotResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/create_network_response.py b/src/cudo_compute/models/create_network_response.py new file mode 100644 index 0000000..ee39a8a --- /dev/null +++ b/src/cudo_compute/models/create_network_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class CreateNetworkResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """CreateNetworkResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CreateNetworkResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateNetworkResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateNetworkResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/create_private_vm_image_response.py b/src/cudo_compute/models/create_private_vm_image_response.py new file mode 100644 index 0000000..c24511c --- /dev/null +++ b/src/cudo_compute/models/create_private_vm_image_response.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class CreatePrivateVMImageResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'image': 'V1PrivateImage' + } + + attribute_map = { + 'image': 'image' + } + + def __init__(self, image=None, _configuration=None): # noqa: E501 + """CreatePrivateVMImageResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._image = None + self.discriminator = None + + if image is not None: + self.image = image + + @property + def image(self): + """Gets the image of this CreatePrivateVMImageResponse. # noqa: E501 + + + :return: The image of this CreatePrivateVMImageResponse. # noqa: E501 + :rtype: V1PrivateImage + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this CreatePrivateVMImageResponse. + + + :param image: The image of this CreatePrivateVMImageResponse. # noqa: E501 + :type: V1PrivateImage + """ + + self._image = image + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CreatePrivateVMImageResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreatePrivateVMImageResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreatePrivateVMImageResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/create_security_group_response.py b/src/cudo_compute/models/create_security_group_response.py new file mode 100644 index 0000000..3f119ee --- /dev/null +++ b/src/cudo_compute/models/create_security_group_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class CreateSecurityGroupResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'security_group': 'SecurityGroup' + } + + attribute_map = { + 'security_group': 'securityGroup' + } + + def __init__(self, security_group=None, _configuration=None): # noqa: E501 + """CreateSecurityGroupResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._security_group = None + self.discriminator = None + + self.security_group = security_group + + @property + def security_group(self): + """Gets the security_group of this CreateSecurityGroupResponse. # noqa: E501 + + + :return: The security_group of this CreateSecurityGroupResponse. # noqa: E501 + :rtype: SecurityGroup + """ + return self._security_group + + @security_group.setter + def security_group(self, security_group): + """Sets the security_group of this CreateSecurityGroupResponse. + + + :param security_group: The security_group of this CreateSecurityGroupResponse. # noqa: E501 + :type: SecurityGroup + """ + if self._configuration.client_side_validation and security_group is None: + raise ValueError("Invalid value for `security_group`, must not be `None`") # noqa: E501 + + self._security_group = security_group + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CreateSecurityGroupResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateSecurityGroupResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateSecurityGroupResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/create_storage_disk_response.py b/src/cudo_compute/models/create_storage_disk_response.py new file mode 100644 index 0000000..f6691a6 --- /dev/null +++ b/src/cudo_compute/models/create_storage_disk_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class CreateStorageDiskResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """CreateStorageDiskResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CreateStorageDiskResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateStorageDiskResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateStorageDiskResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/create_vm_request_nic.py b/src/cudo_compute/models/create_vm_request_nic.py new file mode 100644 index 0000000..12a2b1c --- /dev/null +++ b/src/cudo_compute/models/create_vm_request_nic.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class CreateVMRequestNIC(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'assign_public_ip': 'bool', + 'network_id': 'str', + 'security_group_ids': 'list[str]' + } + + attribute_map = { + 'assign_public_ip': 'assignPublicIp', + 'network_id': 'networkId', + 'security_group_ids': 'securityGroupIds' + } + + def __init__(self, assign_public_ip=None, network_id=None, security_group_ids=None, _configuration=None): # noqa: E501 + """CreateVMRequestNIC - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._assign_public_ip = None + self._network_id = None + self._security_group_ids = None + self.discriminator = None + + if assign_public_ip is not None: + self.assign_public_ip = assign_public_ip + if network_id is not None: + self.network_id = network_id + if security_group_ids is not None: + self.security_group_ids = security_group_ids + + @property + def assign_public_ip(self): + """Gets the assign_public_ip of this CreateVMRequestNIC. # noqa: E501 + + + :return: The assign_public_ip of this CreateVMRequestNIC. # noqa: E501 + :rtype: bool + """ + return self._assign_public_ip + + @assign_public_ip.setter + def assign_public_ip(self, assign_public_ip): + """Sets the assign_public_ip of this CreateVMRequestNIC. + + + :param assign_public_ip: The assign_public_ip of this CreateVMRequestNIC. # noqa: E501 + :type: bool + """ + + self._assign_public_ip = assign_public_ip + + @property + def network_id(self): + """Gets the network_id of this CreateVMRequestNIC. # noqa: E501 + + + :return: The network_id of this CreateVMRequestNIC. # noqa: E501 + :rtype: str + """ + return self._network_id + + @network_id.setter + def network_id(self, network_id): + """Sets the network_id of this CreateVMRequestNIC. + + + :param network_id: The network_id of this CreateVMRequestNIC. # noqa: E501 + :type: str + """ + + self._network_id = network_id + + @property + def security_group_ids(self): + """Gets the security_group_ids of this CreateVMRequestNIC. # noqa: E501 + + + :return: The security_group_ids of this CreateVMRequestNIC. # noqa: E501 + :rtype: list[str] + """ + return self._security_group_ids + + @security_group_ids.setter + def security_group_ids(self, security_group_ids): + """Sets the security_group_ids of this CreateVMRequestNIC. + + + :param security_group_ids: The security_group_ids of this CreateVMRequestNIC. # noqa: E501 + :type: list[str] + """ + + self._security_group_ids = security_group_ids + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CreateVMRequestNIC, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateVMRequestNIC): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateVMRequestNIC): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/create_vm_response.py b/src/cudo_compute/models/create_vm_response.py new file mode 100644 index 0000000..2bd09b5 --- /dev/null +++ b/src/cudo_compute/models/create_vm_response.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class CreateVMResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'vm': 'VM' + } + + attribute_map = { + 'id': 'id', + 'vm': 'vm' + } + + def __init__(self, id=None, vm=None, _configuration=None): # noqa: E501 + """CreateVMResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._id = None + self._vm = None + self.discriminator = None + + self.id = id + if vm is not None: + self.vm = vm + + @property + def id(self): + """Gets the id of this CreateVMResponse. # noqa: E501 + + + :return: The id of this CreateVMResponse. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CreateVMResponse. + + + :param id: The id of this CreateVMResponse. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def vm(self): + """Gets the vm of this CreateVMResponse. # noqa: E501 + + + :return: The vm of this CreateVMResponse. # noqa: E501 + :rtype: VM + """ + return self._vm + + @vm.setter + def vm(self, vm): + """Sets the vm of this CreateVMResponse. + + + :param vm: The vm of this CreateVMResponse. # noqa: E501 + :type: VM + """ + + self._vm = vm + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CreateVMResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreateVMResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CreateVMResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/data_center_category.py b/src/cudo_compute/models/data_center_category.py new file mode 100644 index 0000000..6b9d843 --- /dev/null +++ b/src/cudo_compute/models/data_center_category.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class DataCenterCategory(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'count_vm_available': 'int', + 'id': 'str', + 'min_price_hr': 'Decimal', + 'renewable_energy': 'bool' + } + + attribute_map = { + 'count_vm_available': 'countVmAvailable', + 'id': 'id', + 'min_price_hr': 'minPriceHr', + 'renewable_energy': 'renewableEnergy' + } + + def __init__(self, count_vm_available=None, id=None, min_price_hr=None, renewable_energy=None, _configuration=None): # noqa: E501 + """DataCenterCategory - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._count_vm_available = None + self._id = None + self._min_price_hr = None + self._renewable_energy = None + self.discriminator = None + + self.count_vm_available = count_vm_available + self.id = id + self.min_price_hr = min_price_hr + self.renewable_energy = renewable_energy + + @property + def count_vm_available(self): + """Gets the count_vm_available of this DataCenterCategory. # noqa: E501 + + + :return: The count_vm_available of this DataCenterCategory. # noqa: E501 + :rtype: int + """ + return self._count_vm_available + + @count_vm_available.setter + def count_vm_available(self, count_vm_available): + """Sets the count_vm_available of this DataCenterCategory. + + + :param count_vm_available: The count_vm_available of this DataCenterCategory. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and count_vm_available is None: + raise ValueError("Invalid value for `count_vm_available`, must not be `None`") # noqa: E501 + + self._count_vm_available = count_vm_available + + @property + def id(self): + """Gets the id of this DataCenterCategory. # noqa: E501 + + + :return: The id of this DataCenterCategory. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DataCenterCategory. + + + :param id: The id of this DataCenterCategory. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def min_price_hr(self): + """Gets the min_price_hr of this DataCenterCategory. # noqa: E501 + + + :return: The min_price_hr of this DataCenterCategory. # noqa: E501 + :rtype: Decimal + """ + return self._min_price_hr + + @min_price_hr.setter + def min_price_hr(self, min_price_hr): + """Sets the min_price_hr of this DataCenterCategory. + + + :param min_price_hr: The min_price_hr of this DataCenterCategory. # noqa: E501 + :type: Decimal + """ + if self._configuration.client_side_validation and min_price_hr is None: + raise ValueError("Invalid value for `min_price_hr`, must not be `None`") # noqa: E501 + + self._min_price_hr = min_price_hr + + @property + def renewable_energy(self): + """Gets the renewable_energy of this DataCenterCategory. # noqa: E501 + + + :return: The renewable_energy of this DataCenterCategory. # noqa: E501 + :rtype: bool + """ + return self._renewable_energy + + @renewable_energy.setter + def renewable_energy(self, renewable_energy): + """Sets the renewable_energy of this DataCenterCategory. + + + :param renewable_energy: The renewable_energy of this DataCenterCategory. # noqa: E501 + :type: bool + """ + if self._configuration.client_side_validation and renewable_energy is None: + raise ValueError("Invalid value for `renewable_energy`, must not be `None`") # noqa: E501 + + self._renewable_energy = renewable_energy + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DataCenterCategory, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DataCenterCategory): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DataCenterCategory): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/decimal.py b/src/cudo_compute/models/decimal.py new file mode 100644 index 0000000..103a893 --- /dev/null +++ b/src/cudo_compute/models/decimal.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Decimal(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'value': 'str' + } + + attribute_map = { + 'value': 'value' + } + + def __init__(self, value=None, _configuration=None): # noqa: E501 + """Decimal - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._value = None + self.discriminator = None + + if value is not None: + self.value = value + + @property + def value(self): + """Gets the value of this Decimal. # noqa: E501 + + The decimal value, as a string. The string representation consists of an optional sign, `+` (`U+002B`) or `-` (`U+002D`), followed by a sequence of zero or more decimal digits (\"the integer\"), optionally followed by a fraction, optionally followed by an exponent. The fraction consists of a decimal point followed by zero or more decimal digits. The string must contain at least one digit in either the integer or the fraction. The number formed by the sign, the integer and the fraction is referred to as the significand. The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`) followed by one or more decimal digits. Services **should** normalize decimal values before storing them by: - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`). - Replacing a zero-length integer value with `0` (`.5` -> `0.5`). - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`). - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`). Services **may** perform additional normalization based on its own needs and the internal decimal implementation selected, such as shifting the decimal point and exponent value together (example: `2.5e-1` <-> `0.25`). Additionally, services **may** preserve trailing zeroes in the fraction to indicate increased precision, but are not required to do so. Note that only the `.` character is supported to divide the integer and the fraction; `,` **should not** be supported regardless of locale. Additionally, thousand separators **should not** be supported. If a service does support them, values **must** be normalized. The ENBF grammar is: DecimalString = [Sign] Significand [Exponent]; Sign = '+' | '-'; Significand = Digits ['.'] [Digits] | [Digits] '.' Digits; Exponent = ('e' | 'E') [Sign] Digits; Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' }; Services **should** clearly document the range of supported values, the maximum supported precision (total number of digits), and, if applicable, the scale (number of digits after the decimal point), as well as how it behaves when receiving out-of-bounds values. Services **may** choose to accept values passed as input even when the value has a higher precision or scale than the service supports, and **should** round the value to fit the supported scale. Alternatively, the service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC) if precision would be lost. Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC) if the service receives a value outside of the supported range. # noqa: E501 + + :return: The value of this Decimal. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this Decimal. + + The decimal value, as a string. The string representation consists of an optional sign, `+` (`U+002B`) or `-` (`U+002D`), followed by a sequence of zero or more decimal digits (\"the integer\"), optionally followed by a fraction, optionally followed by an exponent. The fraction consists of a decimal point followed by zero or more decimal digits. The string must contain at least one digit in either the integer or the fraction. The number formed by the sign, the integer and the fraction is referred to as the significand. The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`) followed by one or more decimal digits. Services **should** normalize decimal values before storing them by: - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`). - Replacing a zero-length integer value with `0` (`.5` -> `0.5`). - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`). - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`). Services **may** perform additional normalization based on its own needs and the internal decimal implementation selected, such as shifting the decimal point and exponent value together (example: `2.5e-1` <-> `0.25`). Additionally, services **may** preserve trailing zeroes in the fraction to indicate increased precision, but are not required to do so. Note that only the `.` character is supported to divide the integer and the fraction; `,` **should not** be supported regardless of locale. Additionally, thousand separators **should not** be supported. If a service does support them, values **must** be normalized. The ENBF grammar is: DecimalString = [Sign] Significand [Exponent]; Sign = '+' | '-'; Significand = Digits ['.'] [Digits] | [Digits] '.' Digits; Exponent = ('e' | 'E') [Sign] Digits; Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' }; Services **should** clearly document the range of supported values, the maximum supported precision (total number of digits), and, if applicable, the scale (number of digits after the decimal point), as well as how it behaves when receiving out-of-bounds values. Services **may** choose to accept values passed as input even when the value has a higher precision or scale than the service supports, and **should** round the value to fit the supported scale. Alternatively, the service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC) if precision would be lost. Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC) if the service receives a value outside of the supported range. # noqa: E501 + + :param value: The value of this Decimal. # noqa: E501 + :type: str + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Decimal, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Decimal): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Decimal): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/delete_disk_snapshot_response.py b/src/cudo_compute/models/delete_disk_snapshot_response.py new file mode 100644 index 0000000..be433c3 --- /dev/null +++ b/src/cudo_compute/models/delete_disk_snapshot_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class DeleteDiskSnapshotResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """DeleteDiskSnapshotResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DeleteDiskSnapshotResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeleteDiskSnapshotResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DeleteDiskSnapshotResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/delete_network_response.py b/src/cudo_compute/models/delete_network_response.py new file mode 100644 index 0000000..a3248d9 --- /dev/null +++ b/src/cudo_compute/models/delete_network_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class DeleteNetworkResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """DeleteNetworkResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DeleteNetworkResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeleteNetworkResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DeleteNetworkResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/delete_object_storage_key_response.py b/src/cudo_compute/models/delete_object_storage_key_response.py new file mode 100644 index 0000000..bf9b267 --- /dev/null +++ b/src/cudo_compute/models/delete_object_storage_key_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class DeleteObjectStorageKeyResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """DeleteObjectStorageKeyResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DeleteObjectStorageKeyResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeleteObjectStorageKeyResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DeleteObjectStorageKeyResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/delete_object_storage_user_response.py b/src/cudo_compute/models/delete_object_storage_user_response.py new file mode 100644 index 0000000..4a3eb37 --- /dev/null +++ b/src/cudo_compute/models/delete_object_storage_user_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class DeleteObjectStorageUserResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """DeleteObjectStorageUserResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DeleteObjectStorageUserResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeleteObjectStorageUserResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DeleteObjectStorageUserResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/delete_private_vm_image_response.py b/src/cudo_compute/models/delete_private_vm_image_response.py new file mode 100644 index 0000000..a597c90 --- /dev/null +++ b/src/cudo_compute/models/delete_private_vm_image_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class DeletePrivateVMImageResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """DeletePrivateVMImageResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DeletePrivateVMImageResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeletePrivateVMImageResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DeletePrivateVMImageResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/delete_security_group_response.py b/src/cudo_compute/models/delete_security_group_response.py new file mode 100644 index 0000000..0c908be --- /dev/null +++ b/src/cudo_compute/models/delete_security_group_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class DeleteSecurityGroupResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """DeleteSecurityGroupResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DeleteSecurityGroupResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeleteSecurityGroupResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DeleteSecurityGroupResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/delete_storage_disk_response.py b/src/cudo_compute/models/delete_storage_disk_response.py new file mode 100644 index 0000000..a2b6f19 --- /dev/null +++ b/src/cudo_compute/models/delete_storage_disk_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class DeleteStorageDiskResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """DeleteStorageDiskResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DeleteStorageDiskResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeleteStorageDiskResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DeleteStorageDiskResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/detach_storage_disk_response.py b/src/cudo_compute/models/detach_storage_disk_response.py new file mode 100644 index 0000000..2a274bf --- /dev/null +++ b/src/cudo_compute/models/detach_storage_disk_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class DetachStorageDiskResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """DetachStorageDiskResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DetachStorageDiskResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DetachStorageDiskResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DetachStorageDiskResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/disk.py b/src/cudo_compute/models/disk.py new file mode 100644 index 0000000..6c7336e --- /dev/null +++ b/src/cudo_compute/models/disk.py @@ -0,0 +1,385 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Disk(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'create_time': 'datetime', + 'data_center_id': 'str', + 'disk_state': 'DiskState', + 'disk_type': 'DiskType', + 'id': 'str', + 'private_image_id': 'str', + 'project_id': 'str', + 'public_image_id': 'str', + 'size_gib': 'int', + 'storage_class': 'DiskStorageClass', + 'vm_id': 'str' + } + + attribute_map = { + 'create_time': 'createTime', + 'data_center_id': 'dataCenterId', + 'disk_state': 'diskState', + 'disk_type': 'diskType', + 'id': 'id', + 'private_image_id': 'privateImageId', + 'project_id': 'projectId', + 'public_image_id': 'publicImageId', + 'size_gib': 'sizeGib', + 'storage_class': 'storageClass', + 'vm_id': 'vmId' + } + + def __init__(self, create_time=None, data_center_id=None, disk_state=None, disk_type=None, id=None, private_image_id=None, project_id=None, public_image_id=None, size_gib=None, storage_class=None, vm_id=None, _configuration=None): # noqa: E501 + """Disk - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._create_time = None + self._data_center_id = None + self._disk_state = None + self._disk_type = None + self._id = None + self._private_image_id = None + self._project_id = None + self._public_image_id = None + self._size_gib = None + self._storage_class = None + self._vm_id = None + self.discriminator = None + + if create_time is not None: + self.create_time = create_time + if data_center_id is not None: + self.data_center_id = data_center_id + if disk_state is not None: + self.disk_state = disk_state + if disk_type is not None: + self.disk_type = disk_type + self.id = id + if private_image_id is not None: + self.private_image_id = private_image_id + if project_id is not None: + self.project_id = project_id + if public_image_id is not None: + self.public_image_id = public_image_id + self.size_gib = size_gib + if storage_class is not None: + self.storage_class = storage_class + if vm_id is not None: + self.vm_id = vm_id + + @property + def create_time(self): + """Gets the create_time of this Disk. # noqa: E501 + + + :return: The create_time of this Disk. # noqa: E501 + :rtype: datetime + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this Disk. + + + :param create_time: The create_time of this Disk. # noqa: E501 + :type: datetime + """ + + self._create_time = create_time + + @property + def data_center_id(self): + """Gets the data_center_id of this Disk. # noqa: E501 + + + :return: The data_center_id of this Disk. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this Disk. + + + :param data_center_id: The data_center_id of this Disk. # noqa: E501 + :type: str + """ + + self._data_center_id = data_center_id + + @property + def disk_state(self): + """Gets the disk_state of this Disk. # noqa: E501 + + + :return: The disk_state of this Disk. # noqa: E501 + :rtype: DiskState + """ + return self._disk_state + + @disk_state.setter + def disk_state(self, disk_state): + """Sets the disk_state of this Disk. + + + :param disk_state: The disk_state of this Disk. # noqa: E501 + :type: DiskState + """ + + self._disk_state = disk_state + + @property + def disk_type(self): + """Gets the disk_type of this Disk. # noqa: E501 + + + :return: The disk_type of this Disk. # noqa: E501 + :rtype: DiskType + """ + return self._disk_type + + @disk_type.setter + def disk_type(self, disk_type): + """Sets the disk_type of this Disk. + + + :param disk_type: The disk_type of this Disk. # noqa: E501 + :type: DiskType + """ + + self._disk_type = disk_type + + @property + def id(self): + """Gets the id of this Disk. # noqa: E501 + + + :return: The id of this Disk. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Disk. + + + :param id: The id of this Disk. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def private_image_id(self): + """Gets the private_image_id of this Disk. # noqa: E501 + + + :return: The private_image_id of this Disk. # noqa: E501 + :rtype: str + """ + return self._private_image_id + + @private_image_id.setter + def private_image_id(self, private_image_id): + """Sets the private_image_id of this Disk. + + + :param private_image_id: The private_image_id of this Disk. # noqa: E501 + :type: str + """ + + self._private_image_id = private_image_id + + @property + def project_id(self): + """Gets the project_id of this Disk. # noqa: E501 + + + :return: The project_id of this Disk. # noqa: E501 + :rtype: str + """ + return self._project_id + + @project_id.setter + def project_id(self, project_id): + """Sets the project_id of this Disk. + + + :param project_id: The project_id of this Disk. # noqa: E501 + :type: str + """ + + self._project_id = project_id + + @property + def public_image_id(self): + """Gets the public_image_id of this Disk. # noqa: E501 + + + :return: The public_image_id of this Disk. # noqa: E501 + :rtype: str + """ + return self._public_image_id + + @public_image_id.setter + def public_image_id(self, public_image_id): + """Sets the public_image_id of this Disk. + + + :param public_image_id: The public_image_id of this Disk. # noqa: E501 + :type: str + """ + + self._public_image_id = public_image_id + + @property + def size_gib(self): + """Gets the size_gib of this Disk. # noqa: E501 + + + :return: The size_gib of this Disk. # noqa: E501 + :rtype: int + """ + return self._size_gib + + @size_gib.setter + def size_gib(self, size_gib): + """Sets the size_gib of this Disk. + + + :param size_gib: The size_gib of this Disk. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and size_gib is None: + raise ValueError("Invalid value for `size_gib`, must not be `None`") # noqa: E501 + + self._size_gib = size_gib + + @property + def storage_class(self): + """Gets the storage_class of this Disk. # noqa: E501 + + + :return: The storage_class of this Disk. # noqa: E501 + :rtype: DiskStorageClass + """ + return self._storage_class + + @storage_class.setter + def storage_class(self, storage_class): + """Sets the storage_class of this Disk. + + + :param storage_class: The storage_class of this Disk. # noqa: E501 + :type: DiskStorageClass + """ + + self._storage_class = storage_class + + @property + def vm_id(self): + """Gets the vm_id of this Disk. # noqa: E501 + + + :return: The vm_id of this Disk. # noqa: E501 + :rtype: str + """ + return self._vm_id + + @vm_id.setter + def vm_id(self, vm_id): + """Sets the vm_id of this Disk. + + + :param vm_id: The vm_id of this Disk. # noqa: E501 + :type: str + """ + + self._vm_id = vm_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Disk, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Disk): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Disk): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/disk_state.py b/src/cudo_compute/models/disk_state.py new file mode 100644 index 0000000..9ea707d --- /dev/null +++ b/src/cudo_compute/models/disk_state.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class DiskState(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + INIT = "DISK_STATE_INIT" + READY = "DISK_STATE_READY" + USED = "DISK_STATE_USED" + DISABLED = "DISK_STATE_DISABLED" + LOCKED = "DISK_STATE_LOCKED" + ERROR = "DISK_STATE_ERROR" + CLONE = "DISK_STATE_CLONE" + DELETE = "DISK_STATE_DELETE" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """DiskState - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DiskState, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DiskState): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DiskState): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/disk_storage_class.py b/src/cudo_compute/models/disk_storage_class.py new file mode 100644 index 0000000..7124c92 --- /dev/null +++ b/src/cudo_compute/models/disk_storage_class.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class DiskStorageClass(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + UNKNOWN = "STORAGE_CLASS_UNKNOWN" + LOCAL = "STORAGE_CLASS_LOCAL" + NETWORK = "STORAGE_CLASS_NETWORK" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """DiskStorageClass - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DiskStorageClass, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DiskStorageClass): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DiskStorageClass): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/disk_storage_price_hr.py b/src/cudo_compute/models/disk_storage_price_hr.py new file mode 100644 index 0000000..3ac0845 --- /dev/null +++ b/src/cudo_compute/models/disk_storage_price_hr.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class DiskStoragePriceHr(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'disk_gib_price_hr': 'Decimal', + 'snapshot_gib_price_hr': 'Decimal', + 'storage_class': 'VMDataCenterStorageClass' + } + + attribute_map = { + 'disk_gib_price_hr': 'diskGibPriceHr', + 'snapshot_gib_price_hr': 'snapshotGibPriceHr', + 'storage_class': 'storageClass' + } + + def __init__(self, disk_gib_price_hr=None, snapshot_gib_price_hr=None, storage_class=None, _configuration=None): # noqa: E501 + """DiskStoragePriceHr - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._disk_gib_price_hr = None + self._snapshot_gib_price_hr = None + self._storage_class = None + self.discriminator = None + + if disk_gib_price_hr is not None: + self.disk_gib_price_hr = disk_gib_price_hr + if snapshot_gib_price_hr is not None: + self.snapshot_gib_price_hr = snapshot_gib_price_hr + if storage_class is not None: + self.storage_class = storage_class + + @property + def disk_gib_price_hr(self): + """Gets the disk_gib_price_hr of this DiskStoragePriceHr. # noqa: E501 + + + :return: The disk_gib_price_hr of this DiskStoragePriceHr. # noqa: E501 + :rtype: Decimal + """ + return self._disk_gib_price_hr + + @disk_gib_price_hr.setter + def disk_gib_price_hr(self, disk_gib_price_hr): + """Sets the disk_gib_price_hr of this DiskStoragePriceHr. + + + :param disk_gib_price_hr: The disk_gib_price_hr of this DiskStoragePriceHr. # noqa: E501 + :type: Decimal + """ + + self._disk_gib_price_hr = disk_gib_price_hr + + @property + def snapshot_gib_price_hr(self): + """Gets the snapshot_gib_price_hr of this DiskStoragePriceHr. # noqa: E501 + + + :return: The snapshot_gib_price_hr of this DiskStoragePriceHr. # noqa: E501 + :rtype: Decimal + """ + return self._snapshot_gib_price_hr + + @snapshot_gib_price_hr.setter + def snapshot_gib_price_hr(self, snapshot_gib_price_hr): + """Sets the snapshot_gib_price_hr of this DiskStoragePriceHr. + + + :param snapshot_gib_price_hr: The snapshot_gib_price_hr of this DiskStoragePriceHr. # noqa: E501 + :type: Decimal + """ + + self._snapshot_gib_price_hr = snapshot_gib_price_hr + + @property + def storage_class(self): + """Gets the storage_class of this DiskStoragePriceHr. # noqa: E501 + + + :return: The storage_class of this DiskStoragePriceHr. # noqa: E501 + :rtype: VMDataCenterStorageClass + """ + return self._storage_class + + @storage_class.setter + def storage_class(self, storage_class): + """Sets the storage_class of this DiskStoragePriceHr. + + + :param storage_class: The storage_class of this DiskStoragePriceHr. # noqa: E501 + :type: VMDataCenterStorageClass + """ + + self._storage_class = storage_class + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DiskStoragePriceHr, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DiskStoragePriceHr): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DiskStoragePriceHr): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/disk_type.py b/src/cudo_compute/models/disk_type.py new file mode 100644 index 0000000..1fdacee --- /dev/null +++ b/src/cudo_compute/models/disk_type.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class DiskType(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + UNKNOWN = "DISK_TYPE_UNKNOWN" + BOOT = "DISK_TYPE_BOOT" + STORAGE = "DISK_TYPE_STORAGE" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """DiskType - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DiskType, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DiskType): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DiskType): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/generate_api_key_request.py b/src/cudo_compute/models/generate_api_key_request.py new file mode 100644 index 0000000..fbc552c --- /dev/null +++ b/src/cudo_compute/models/generate_api_key_request.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class GenerateApiKeyRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'apikey_id': 'str' + } + + attribute_map = { + 'apikey_id': 'apikeyId' + } + + def __init__(self, apikey_id=None, _configuration=None): # noqa: E501 + """GenerateApiKeyRequest - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._apikey_id = None + self.discriminator = None + + self.apikey_id = apikey_id + + @property + def apikey_id(self): + """Gets the apikey_id of this GenerateApiKeyRequest. # noqa: E501 + + The identifier to use for the api key, which will become the final component of the api key's resource name. This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. # noqa: E501 + + :return: The apikey_id of this GenerateApiKeyRequest. # noqa: E501 + :rtype: str + """ + return self._apikey_id + + @apikey_id.setter + def apikey_id(self, apikey_id): + """Sets the apikey_id of this GenerateApiKeyRequest. + + The identifier to use for the api key, which will become the final component of the api key's resource name. This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. # noqa: E501 + + :param apikey_id: The apikey_id of this GenerateApiKeyRequest. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and apikey_id is None: + raise ValueError("Invalid value for `apikey_id`, must not be `None`") # noqa: E501 + + self._apikey_id = apikey_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GenerateApiKeyRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GenerateApiKeyRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GenerateApiKeyRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/get_disk_response.py b/src/cudo_compute/models/get_disk_response.py new file mode 100644 index 0000000..ed6339a --- /dev/null +++ b/src/cudo_compute/models/get_disk_response.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class GetDiskResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'disk': 'Disk', + 'snapshots': 'list[Snapshot]' + } + + attribute_map = { + 'disk': 'disk', + 'snapshots': 'snapshots' + } + + def __init__(self, disk=None, snapshots=None, _configuration=None): # noqa: E501 + """GetDiskResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._disk = None + self._snapshots = None + self.discriminator = None + + if disk is not None: + self.disk = disk + if snapshots is not None: + self.snapshots = snapshots + + @property + def disk(self): + """Gets the disk of this GetDiskResponse. # noqa: E501 + + + :return: The disk of this GetDiskResponse. # noqa: E501 + :rtype: Disk + """ + return self._disk + + @disk.setter + def disk(self, disk): + """Sets the disk of this GetDiskResponse. + + + :param disk: The disk of this GetDiskResponse. # noqa: E501 + :type: Disk + """ + + self._disk = disk + + @property + def snapshots(self): + """Gets the snapshots of this GetDiskResponse. # noqa: E501 + + + :return: The snapshots of this GetDiskResponse. # noqa: E501 + :rtype: list[Snapshot] + """ + return self._snapshots + + @snapshots.setter + def snapshots(self, snapshots): + """Sets the snapshots of this GetDiskResponse. + + + :param snapshots: The snapshots of this GetDiskResponse. # noqa: E501 + :type: list[Snapshot] + """ + + self._snapshots = snapshots + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GetDiskResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetDiskResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetDiskResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/get_network_response.py b/src/cudo_compute/models/get_network_response.py new file mode 100644 index 0000000..56c4d0b --- /dev/null +++ b/src/cudo_compute/models/get_network_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class GetNetworkResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'network': 'Network' + } + + attribute_map = { + 'network': 'network' + } + + def __init__(self, network=None, _configuration=None): # noqa: E501 + """GetNetworkResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._network = None + self.discriminator = None + + self.network = network + + @property + def network(self): + """Gets the network of this GetNetworkResponse. # noqa: E501 + + + :return: The network of this GetNetworkResponse. # noqa: E501 + :rtype: Network + """ + return self._network + + @network.setter + def network(self, network): + """Sets the network of this GetNetworkResponse. + + + :param network: The network of this GetNetworkResponse. # noqa: E501 + :type: Network + """ + if self._configuration.client_side_validation and network is None: + raise ValueError("Invalid value for `network`, must not be `None`") # noqa: E501 + + self._network = network + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GetNetworkResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetNetworkResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetNetworkResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/get_object_storage_session_key_response.py b/src/cudo_compute/models/get_object_storage_session_key_response.py new file mode 100644 index 0000000..eebda97 --- /dev/null +++ b/src/cudo_compute/models/get_object_storage_session_key_response.py @@ -0,0 +1,227 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class GetObjectStorageSessionKeyResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'access_key': 'str', + 'endpoint': 'str', + 'secret_key': 'str', + 'session_name': 'str', + 'session_token': 'str' + } + + attribute_map = { + 'access_key': 'accessKey', + 'endpoint': 'endpoint', + 'secret_key': 'secretKey', + 'session_name': 'sessionName', + 'session_token': 'sessionToken' + } + + def __init__(self, access_key=None, endpoint=None, secret_key=None, session_name=None, session_token=None, _configuration=None): # noqa: E501 + """GetObjectStorageSessionKeyResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._access_key = None + self._endpoint = None + self._secret_key = None + self._session_name = None + self._session_token = None + self.discriminator = None + + if access_key is not None: + self.access_key = access_key + if endpoint is not None: + self.endpoint = endpoint + if secret_key is not None: + self.secret_key = secret_key + if session_name is not None: + self.session_name = session_name + if session_token is not None: + self.session_token = session_token + + @property + def access_key(self): + """Gets the access_key of this GetObjectStorageSessionKeyResponse. # noqa: E501 + + + :return: The access_key of this GetObjectStorageSessionKeyResponse. # noqa: E501 + :rtype: str + """ + return self._access_key + + @access_key.setter + def access_key(self, access_key): + """Sets the access_key of this GetObjectStorageSessionKeyResponse. + + + :param access_key: The access_key of this GetObjectStorageSessionKeyResponse. # noqa: E501 + :type: str + """ + + self._access_key = access_key + + @property + def endpoint(self): + """Gets the endpoint of this GetObjectStorageSessionKeyResponse. # noqa: E501 + + + :return: The endpoint of this GetObjectStorageSessionKeyResponse. # noqa: E501 + :rtype: str + """ + return self._endpoint + + @endpoint.setter + def endpoint(self, endpoint): + """Sets the endpoint of this GetObjectStorageSessionKeyResponse. + + + :param endpoint: The endpoint of this GetObjectStorageSessionKeyResponse. # noqa: E501 + :type: str + """ + + self._endpoint = endpoint + + @property + def secret_key(self): + """Gets the secret_key of this GetObjectStorageSessionKeyResponse. # noqa: E501 + + + :return: The secret_key of this GetObjectStorageSessionKeyResponse. # noqa: E501 + :rtype: str + """ + return self._secret_key + + @secret_key.setter + def secret_key(self, secret_key): + """Sets the secret_key of this GetObjectStorageSessionKeyResponse. + + + :param secret_key: The secret_key of this GetObjectStorageSessionKeyResponse. # noqa: E501 + :type: str + """ + + self._secret_key = secret_key + + @property + def session_name(self): + """Gets the session_name of this GetObjectStorageSessionKeyResponse. # noqa: E501 + + + :return: The session_name of this GetObjectStorageSessionKeyResponse. # noqa: E501 + :rtype: str + """ + return self._session_name + + @session_name.setter + def session_name(self, session_name): + """Sets the session_name of this GetObjectStorageSessionKeyResponse. + + + :param session_name: The session_name of this GetObjectStorageSessionKeyResponse. # noqa: E501 + :type: str + """ + + self._session_name = session_name + + @property + def session_token(self): + """Gets the session_token of this GetObjectStorageSessionKeyResponse. # noqa: E501 + + + :return: The session_token of this GetObjectStorageSessionKeyResponse. # noqa: E501 + :rtype: str + """ + return self._session_token + + @session_token.setter + def session_token(self, session_token): + """Sets the session_token of this GetObjectStorageSessionKeyResponse. + + + :param session_token: The session_token of this GetObjectStorageSessionKeyResponse. # noqa: E501 + :type: str + """ + + self._session_token = session_token + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GetObjectStorageSessionKeyResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetObjectStorageSessionKeyResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetObjectStorageSessionKeyResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/get_private_vm_image_response.py b/src/cudo_compute/models/get_private_vm_image_response.py new file mode 100644 index 0000000..a6beed0 --- /dev/null +++ b/src/cudo_compute/models/get_private_vm_image_response.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class GetPrivateVMImageResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'image': 'V1PrivateImage' + } + + attribute_map = { + 'image': 'image' + } + + def __init__(self, image=None, _configuration=None): # noqa: E501 + """GetPrivateVMImageResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._image = None + self.discriminator = None + + if image is not None: + self.image = image + + @property + def image(self): + """Gets the image of this GetPrivateVMImageResponse. # noqa: E501 + + + :return: The image of this GetPrivateVMImageResponse. # noqa: E501 + :rtype: V1PrivateImage + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this GetPrivateVMImageResponse. + + + :param image: The image of this GetPrivateVMImageResponse. # noqa: E501 + :type: V1PrivateImage + """ + + self._image = image + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GetPrivateVMImageResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetPrivateVMImageResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetPrivateVMImageResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/get_security_group_response.py b/src/cudo_compute/models/get_security_group_response.py new file mode 100644 index 0000000..c1b9c94 --- /dev/null +++ b/src/cudo_compute/models/get_security_group_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class GetSecurityGroupResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'security_group': 'SecurityGroup' + } + + attribute_map = { + 'security_group': 'securityGroup' + } + + def __init__(self, security_group=None, _configuration=None): # noqa: E501 + """GetSecurityGroupResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._security_group = None + self.discriminator = None + + self.security_group = security_group + + @property + def security_group(self): + """Gets the security_group of this GetSecurityGroupResponse. # noqa: E501 + + + :return: The security_group of this GetSecurityGroupResponse. # noqa: E501 + :rtype: SecurityGroup + """ + return self._security_group + + @security_group.setter + def security_group(self, security_group): + """Sets the security_group of this GetSecurityGroupResponse. + + + :param security_group: The security_group of this GetSecurityGroupResponse. # noqa: E501 + :type: SecurityGroup + """ + if self._configuration.client_side_validation and security_group is None: + raise ValueError("Invalid value for `security_group`, must not be `None`") # noqa: E501 + + self._security_group = security_group + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GetSecurityGroupResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetSecurityGroupResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetSecurityGroupResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/get_vm_response.py b/src/cudo_compute/models/get_vm_response.py new file mode 100644 index 0000000..7103740 --- /dev/null +++ b/src/cudo_compute/models/get_vm_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class GetVMResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'vm': 'VM' + } + + attribute_map = { + 'vm': 'VM' + } + + def __init__(self, vm=None, _configuration=None): # noqa: E501 + """GetVMResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._vm = None + self.discriminator = None + + self.vm = vm + + @property + def vm(self): + """Gets the vm of this GetVMResponse. # noqa: E501 + + + :return: The vm of this GetVMResponse. # noqa: E501 + :rtype: VM + """ + return self._vm + + @vm.setter + def vm(self, vm): + """Sets the vm of this GetVMResponse. + + + :param vm: The vm of this GetVMResponse. # noqa: E501 + :type: VM + """ + if self._configuration.client_side_validation and vm is None: + raise ValueError("Invalid value for `vm`, must not be `None`") # noqa: E501 + + self._vm = vm + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GetVMResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetVMResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetVMResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/gpu_model_category.py b/src/cudo_compute/models/gpu_model_category.py new file mode 100644 index 0000000..782774a --- /dev/null +++ b/src/cudo_compute/models/gpu_model_category.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class GpuModelCategory(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'count_vm_available': 'int', + 'min_price_hr': 'Decimal', + 'name': 'str' + } + + attribute_map = { + 'count_vm_available': 'countVmAvailable', + 'min_price_hr': 'minPriceHr', + 'name': 'name' + } + + def __init__(self, count_vm_available=None, min_price_hr=None, name=None, _configuration=None): # noqa: E501 + """GpuModelCategory - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._count_vm_available = None + self._min_price_hr = None + self._name = None + self.discriminator = None + + self.count_vm_available = count_vm_available + self.min_price_hr = min_price_hr + self.name = name + + @property + def count_vm_available(self): + """Gets the count_vm_available of this GpuModelCategory. # noqa: E501 + + + :return: The count_vm_available of this GpuModelCategory. # noqa: E501 + :rtype: int + """ + return self._count_vm_available + + @count_vm_available.setter + def count_vm_available(self, count_vm_available): + """Sets the count_vm_available of this GpuModelCategory. + + + :param count_vm_available: The count_vm_available of this GpuModelCategory. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and count_vm_available is None: + raise ValueError("Invalid value for `count_vm_available`, must not be `None`") # noqa: E501 + + self._count_vm_available = count_vm_available + + @property + def min_price_hr(self): + """Gets the min_price_hr of this GpuModelCategory. # noqa: E501 + + + :return: The min_price_hr of this GpuModelCategory. # noqa: E501 + :rtype: Decimal + """ + return self._min_price_hr + + @min_price_hr.setter + def min_price_hr(self, min_price_hr): + """Sets the min_price_hr of this GpuModelCategory. + + + :param min_price_hr: The min_price_hr of this GpuModelCategory. # noqa: E501 + :type: Decimal + """ + if self._configuration.client_side_validation and min_price_hr is None: + raise ValueError("Invalid value for `min_price_hr`, must not be `None`") # noqa: E501 + + self._min_price_hr = min_price_hr + + @property + def name(self): + """Gets the name of this GpuModelCategory. # noqa: E501 + + + :return: The name of this GpuModelCategory. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this GpuModelCategory. + + + :param name: The name of this GpuModelCategory. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GpuModelCategory, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GpuModelCategory): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GpuModelCategory): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/host_config_category.py b/src/cudo_compute/models/host_config_category.py new file mode 100644 index 0000000..c188202 --- /dev/null +++ b/src/cudo_compute/models/host_config_category.py @@ -0,0 +1,556 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class HostConfigCategory(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'count_vm_available': 'int', + 'cpu_model': 'str', + 'data_center_id': 'str', + 'gpu_model': 'str', + 'gpu_price_hr': 'Decimal', + 'id': 'str', + 'ipv4_price_hr': 'Decimal', + 'machine_type': 'str', + 'memory_gib_price_hr': 'Decimal', + 'renewable_energy': 'bool', + 'storage_gib_price_hr': 'Decimal', + 'total_gpu_price_hr': 'Decimal', + 'total_memory_price_hr': 'Decimal', + 'total_price_hr': 'Decimal', + 'total_storage_price_hr': 'Decimal', + 'total_vcpu_price_hr': 'Decimal', + 'vcpu_price_hr': 'Decimal' + } + + attribute_map = { + 'count_vm_available': 'countVmAvailable', + 'cpu_model': 'cpuModel', + 'data_center_id': 'dataCenterId', + 'gpu_model': 'gpuModel', + 'gpu_price_hr': 'gpuPriceHr', + 'id': 'id', + 'ipv4_price_hr': 'ipv4PriceHr', + 'machine_type': 'machineType', + 'memory_gib_price_hr': 'memoryGibPriceHr', + 'renewable_energy': 'renewableEnergy', + 'storage_gib_price_hr': 'storageGibPriceHr', + 'total_gpu_price_hr': 'totalGpuPriceHr', + 'total_memory_price_hr': 'totalMemoryPriceHr', + 'total_price_hr': 'totalPriceHr', + 'total_storage_price_hr': 'totalStoragePriceHr', + 'total_vcpu_price_hr': 'totalVcpuPriceHr', + 'vcpu_price_hr': 'vcpuPriceHr' + } + + def __init__(self, count_vm_available=None, cpu_model=None, data_center_id=None, gpu_model=None, gpu_price_hr=None, id=None, ipv4_price_hr=None, machine_type=None, memory_gib_price_hr=None, renewable_energy=None, storage_gib_price_hr=None, total_gpu_price_hr=None, total_memory_price_hr=None, total_price_hr=None, total_storage_price_hr=None, total_vcpu_price_hr=None, vcpu_price_hr=None, _configuration=None): # noqa: E501 + """HostConfigCategory - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._count_vm_available = None + self._cpu_model = None + self._data_center_id = None + self._gpu_model = None + self._gpu_price_hr = None + self._id = None + self._ipv4_price_hr = None + self._machine_type = None + self._memory_gib_price_hr = None + self._renewable_energy = None + self._storage_gib_price_hr = None + self._total_gpu_price_hr = None + self._total_memory_price_hr = None + self._total_price_hr = None + self._total_storage_price_hr = None + self._total_vcpu_price_hr = None + self._vcpu_price_hr = None + self.discriminator = None + + self.count_vm_available = count_vm_available + self.cpu_model = cpu_model + self.data_center_id = data_center_id + self.gpu_model = gpu_model + self.gpu_price_hr = gpu_price_hr + self.id = id + self.ipv4_price_hr = ipv4_price_hr + self.machine_type = machine_type + self.memory_gib_price_hr = memory_gib_price_hr + self.renewable_energy = renewable_energy + self.storage_gib_price_hr = storage_gib_price_hr + self.total_gpu_price_hr = total_gpu_price_hr + self.total_memory_price_hr = total_memory_price_hr + self.total_price_hr = total_price_hr + self.total_storage_price_hr = total_storage_price_hr + self.total_vcpu_price_hr = total_vcpu_price_hr + self.vcpu_price_hr = vcpu_price_hr + + @property + def count_vm_available(self): + """Gets the count_vm_available of this HostConfigCategory. # noqa: E501 + + + :return: The count_vm_available of this HostConfigCategory. # noqa: E501 + :rtype: int + """ + return self._count_vm_available + + @count_vm_available.setter + def count_vm_available(self, count_vm_available): + """Sets the count_vm_available of this HostConfigCategory. + + + :param count_vm_available: The count_vm_available of this HostConfigCategory. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and count_vm_available is None: + raise ValueError("Invalid value for `count_vm_available`, must not be `None`") # noqa: E501 + + self._count_vm_available = count_vm_available + + @property + def cpu_model(self): + """Gets the cpu_model of this HostConfigCategory. # noqa: E501 + + + :return: The cpu_model of this HostConfigCategory. # noqa: E501 + :rtype: str + """ + return self._cpu_model + + @cpu_model.setter + def cpu_model(self, cpu_model): + """Sets the cpu_model of this HostConfigCategory. + + + :param cpu_model: The cpu_model of this HostConfigCategory. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and cpu_model is None: + raise ValueError("Invalid value for `cpu_model`, must not be `None`") # noqa: E501 + + self._cpu_model = cpu_model + + @property + def data_center_id(self): + """Gets the data_center_id of this HostConfigCategory. # noqa: E501 + + + :return: The data_center_id of this HostConfigCategory. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this HostConfigCategory. + + + :param data_center_id: The data_center_id of this HostConfigCategory. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and data_center_id is None: + raise ValueError("Invalid value for `data_center_id`, must not be `None`") # noqa: E501 + + self._data_center_id = data_center_id + + @property + def gpu_model(self): + """Gets the gpu_model of this HostConfigCategory. # noqa: E501 + + + :return: The gpu_model of this HostConfigCategory. # noqa: E501 + :rtype: str + """ + return self._gpu_model + + @gpu_model.setter + def gpu_model(self, gpu_model): + """Sets the gpu_model of this HostConfigCategory. + + + :param gpu_model: The gpu_model of this HostConfigCategory. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and gpu_model is None: + raise ValueError("Invalid value for `gpu_model`, must not be `None`") # noqa: E501 + + self._gpu_model = gpu_model + + @property + def gpu_price_hr(self): + """Gets the gpu_price_hr of this HostConfigCategory. # noqa: E501 + + + :return: The gpu_price_hr of this HostConfigCategory. # noqa: E501 + :rtype: Decimal + """ + return self._gpu_price_hr + + @gpu_price_hr.setter + def gpu_price_hr(self, gpu_price_hr): + """Sets the gpu_price_hr of this HostConfigCategory. + + + :param gpu_price_hr: The gpu_price_hr of this HostConfigCategory. # noqa: E501 + :type: Decimal + """ + if self._configuration.client_side_validation and gpu_price_hr is None: + raise ValueError("Invalid value for `gpu_price_hr`, must not be `None`") # noqa: E501 + + self._gpu_price_hr = gpu_price_hr + + @property + def id(self): + """Gets the id of this HostConfigCategory. # noqa: E501 + + + :return: The id of this HostConfigCategory. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this HostConfigCategory. + + + :param id: The id of this HostConfigCategory. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def ipv4_price_hr(self): + """Gets the ipv4_price_hr of this HostConfigCategory. # noqa: E501 + + + :return: The ipv4_price_hr of this HostConfigCategory. # noqa: E501 + :rtype: Decimal + """ + return self._ipv4_price_hr + + @ipv4_price_hr.setter + def ipv4_price_hr(self, ipv4_price_hr): + """Sets the ipv4_price_hr of this HostConfigCategory. + + + :param ipv4_price_hr: The ipv4_price_hr of this HostConfigCategory. # noqa: E501 + :type: Decimal + """ + if self._configuration.client_side_validation and ipv4_price_hr is None: + raise ValueError("Invalid value for `ipv4_price_hr`, must not be `None`") # noqa: E501 + + self._ipv4_price_hr = ipv4_price_hr + + @property + def machine_type(self): + """Gets the machine_type of this HostConfigCategory. # noqa: E501 + + + :return: The machine_type of this HostConfigCategory. # noqa: E501 + :rtype: str + """ + return self._machine_type + + @machine_type.setter + def machine_type(self, machine_type): + """Sets the machine_type of this HostConfigCategory. + + + :param machine_type: The machine_type of this HostConfigCategory. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and machine_type is None: + raise ValueError("Invalid value for `machine_type`, must not be `None`") # noqa: E501 + + self._machine_type = machine_type + + @property + def memory_gib_price_hr(self): + """Gets the memory_gib_price_hr of this HostConfigCategory. # noqa: E501 + + + :return: The memory_gib_price_hr of this HostConfigCategory. # noqa: E501 + :rtype: Decimal + """ + return self._memory_gib_price_hr + + @memory_gib_price_hr.setter + def memory_gib_price_hr(self, memory_gib_price_hr): + """Sets the memory_gib_price_hr of this HostConfigCategory. + + + :param memory_gib_price_hr: The memory_gib_price_hr of this HostConfigCategory. # noqa: E501 + :type: Decimal + """ + if self._configuration.client_side_validation and memory_gib_price_hr is None: + raise ValueError("Invalid value for `memory_gib_price_hr`, must not be `None`") # noqa: E501 + + self._memory_gib_price_hr = memory_gib_price_hr + + @property + def renewable_energy(self): + """Gets the renewable_energy of this HostConfigCategory. # noqa: E501 + + + :return: The renewable_energy of this HostConfigCategory. # noqa: E501 + :rtype: bool + """ + return self._renewable_energy + + @renewable_energy.setter + def renewable_energy(self, renewable_energy): + """Sets the renewable_energy of this HostConfigCategory. + + + :param renewable_energy: The renewable_energy of this HostConfigCategory. # noqa: E501 + :type: bool + """ + if self._configuration.client_side_validation and renewable_energy is None: + raise ValueError("Invalid value for `renewable_energy`, must not be `None`") # noqa: E501 + + self._renewable_energy = renewable_energy + + @property + def storage_gib_price_hr(self): + """Gets the storage_gib_price_hr of this HostConfigCategory. # noqa: E501 + + + :return: The storage_gib_price_hr of this HostConfigCategory. # noqa: E501 + :rtype: Decimal + """ + return self._storage_gib_price_hr + + @storage_gib_price_hr.setter + def storage_gib_price_hr(self, storage_gib_price_hr): + """Sets the storage_gib_price_hr of this HostConfigCategory. + + + :param storage_gib_price_hr: The storage_gib_price_hr of this HostConfigCategory. # noqa: E501 + :type: Decimal + """ + if self._configuration.client_side_validation and storage_gib_price_hr is None: + raise ValueError("Invalid value for `storage_gib_price_hr`, must not be `None`") # noqa: E501 + + self._storage_gib_price_hr = storage_gib_price_hr + + @property + def total_gpu_price_hr(self): + """Gets the total_gpu_price_hr of this HostConfigCategory. # noqa: E501 + + + :return: The total_gpu_price_hr of this HostConfigCategory. # noqa: E501 + :rtype: Decimal + """ + return self._total_gpu_price_hr + + @total_gpu_price_hr.setter + def total_gpu_price_hr(self, total_gpu_price_hr): + """Sets the total_gpu_price_hr of this HostConfigCategory. + + + :param total_gpu_price_hr: The total_gpu_price_hr of this HostConfigCategory. # noqa: E501 + :type: Decimal + """ + if self._configuration.client_side_validation and total_gpu_price_hr is None: + raise ValueError("Invalid value for `total_gpu_price_hr`, must not be `None`") # noqa: E501 + + self._total_gpu_price_hr = total_gpu_price_hr + + @property + def total_memory_price_hr(self): + """Gets the total_memory_price_hr of this HostConfigCategory. # noqa: E501 + + + :return: The total_memory_price_hr of this HostConfigCategory. # noqa: E501 + :rtype: Decimal + """ + return self._total_memory_price_hr + + @total_memory_price_hr.setter + def total_memory_price_hr(self, total_memory_price_hr): + """Sets the total_memory_price_hr of this HostConfigCategory. + + + :param total_memory_price_hr: The total_memory_price_hr of this HostConfigCategory. # noqa: E501 + :type: Decimal + """ + if self._configuration.client_side_validation and total_memory_price_hr is None: + raise ValueError("Invalid value for `total_memory_price_hr`, must not be `None`") # noqa: E501 + + self._total_memory_price_hr = total_memory_price_hr + + @property + def total_price_hr(self): + """Gets the total_price_hr of this HostConfigCategory. # noqa: E501 + + + :return: The total_price_hr of this HostConfigCategory. # noqa: E501 + :rtype: Decimal + """ + return self._total_price_hr + + @total_price_hr.setter + def total_price_hr(self, total_price_hr): + """Sets the total_price_hr of this HostConfigCategory. + + + :param total_price_hr: The total_price_hr of this HostConfigCategory. # noqa: E501 + :type: Decimal + """ + if self._configuration.client_side_validation and total_price_hr is None: + raise ValueError("Invalid value for `total_price_hr`, must not be `None`") # noqa: E501 + + self._total_price_hr = total_price_hr + + @property + def total_storage_price_hr(self): + """Gets the total_storage_price_hr of this HostConfigCategory. # noqa: E501 + + + :return: The total_storage_price_hr of this HostConfigCategory. # noqa: E501 + :rtype: Decimal + """ + return self._total_storage_price_hr + + @total_storage_price_hr.setter + def total_storage_price_hr(self, total_storage_price_hr): + """Sets the total_storage_price_hr of this HostConfigCategory. + + + :param total_storage_price_hr: The total_storage_price_hr of this HostConfigCategory. # noqa: E501 + :type: Decimal + """ + if self._configuration.client_side_validation and total_storage_price_hr is None: + raise ValueError("Invalid value for `total_storage_price_hr`, must not be `None`") # noqa: E501 + + self._total_storage_price_hr = total_storage_price_hr + + @property + def total_vcpu_price_hr(self): + """Gets the total_vcpu_price_hr of this HostConfigCategory. # noqa: E501 + + + :return: The total_vcpu_price_hr of this HostConfigCategory. # noqa: E501 + :rtype: Decimal + """ + return self._total_vcpu_price_hr + + @total_vcpu_price_hr.setter + def total_vcpu_price_hr(self, total_vcpu_price_hr): + """Sets the total_vcpu_price_hr of this HostConfigCategory. + + + :param total_vcpu_price_hr: The total_vcpu_price_hr of this HostConfigCategory. # noqa: E501 + :type: Decimal + """ + if self._configuration.client_side_validation and total_vcpu_price_hr is None: + raise ValueError("Invalid value for `total_vcpu_price_hr`, must not be `None`") # noqa: E501 + + self._total_vcpu_price_hr = total_vcpu_price_hr + + @property + def vcpu_price_hr(self): + """Gets the vcpu_price_hr of this HostConfigCategory. # noqa: E501 + + + :return: The vcpu_price_hr of this HostConfigCategory. # noqa: E501 + :rtype: Decimal + """ + return self._vcpu_price_hr + + @vcpu_price_hr.setter + def vcpu_price_hr(self, vcpu_price_hr): + """Sets the vcpu_price_hr of this HostConfigCategory. + + + :param vcpu_price_hr: The vcpu_price_hr of this HostConfigCategory. # noqa: E501 + :type: Decimal + """ + if self._configuration.client_side_validation and vcpu_price_hr is None: + raise ValueError("Invalid value for `vcpu_price_hr`, must not be `None`") # noqa: E501 + + self._vcpu_price_hr = vcpu_price_hr + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(HostConfigCategory, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, HostConfigCategory): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, HostConfigCategory): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/identity_verification_session.py b/src/cudo_compute/models/identity_verification_session.py new file mode 100644 index 0000000..ec22bc8 --- /dev/null +++ b/src/cudo_compute/models/identity_verification_session.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class IdentityVerificationSession(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'client_secret': 'str', + 'id': 'str' + } + + attribute_map = { + 'client_secret': 'clientSecret', + 'id': 'id' + } + + def __init__(self, client_secret=None, id=None, _configuration=None): # noqa: E501 + """IdentityVerificationSession - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._client_secret = None + self._id = None + self.discriminator = None + + if client_secret is not None: + self.client_secret = client_secret + if id is not None: + self.id = id + + @property + def client_secret(self): + """Gets the client_secret of this IdentityVerificationSession. # noqa: E501 + + + :return: The client_secret of this IdentityVerificationSession. # noqa: E501 + :rtype: str + """ + return self._client_secret + + @client_secret.setter + def client_secret(self, client_secret): + """Sets the client_secret of this IdentityVerificationSession. + + + :param client_secret: The client_secret of this IdentityVerificationSession. # noqa: E501 + :type: str + """ + + self._client_secret = client_secret + + @property + def id(self): + """Gets the id of this IdentityVerificationSession. # noqa: E501 + + + :return: The id of this IdentityVerificationSession. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this IdentityVerificationSession. + + + :param id: The id of this IdentityVerificationSession. # noqa: E501 + :type: str + """ + + self._id = id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IdentityVerificationSession, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IdentityVerificationSession): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, IdentityVerificationSession): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/image.py b/src/cudo_compute/models/image.py new file mode 100644 index 0000000..ec3641a --- /dev/null +++ b/src/cudo_compute/models/image.py @@ -0,0 +1,259 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Image(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'description': 'str', + 'display_name': 'str', + 'id': 'str', + 'name': 'str', + 'platform': 'str', + 'size_gib': 'int' + } + + attribute_map = { + 'description': 'description', + 'display_name': 'displayName', + 'id': 'id', + 'name': 'name', + 'platform': 'platform', + 'size_gib': 'sizeGib' + } + + def __init__(self, description=None, display_name=None, id=None, name=None, platform=None, size_gib=None, _configuration=None): # noqa: E501 + """Image - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._description = None + self._display_name = None + self._id = None + self._name = None + self._platform = None + self._size_gib = None + self.discriminator = None + + self.description = description + self.display_name = display_name + self.id = id + self.name = name + self.platform = platform + self.size_gib = size_gib + + @property + def description(self): + """Gets the description of this Image. # noqa: E501 + + + :return: The description of this Image. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this Image. + + + :param description: The description of this Image. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and description is None: + raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501 + + self._description = description + + @property + def display_name(self): + """Gets the display_name of this Image. # noqa: E501 + + + :return: The display_name of this Image. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this Image. + + + :param display_name: The display_name of this Image. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and display_name is None: + raise ValueError("Invalid value for `display_name`, must not be `None`") # noqa: E501 + + self._display_name = display_name + + @property + def id(self): + """Gets the id of this Image. # noqa: E501 + + + :return: The id of this Image. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Image. + + + :param id: The id of this Image. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this Image. # noqa: E501 + + + :return: The name of this Image. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Image. + + + :param name: The name of this Image. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def platform(self): + """Gets the platform of this Image. # noqa: E501 + + + :return: The platform of this Image. # noqa: E501 + :rtype: str + """ + return self._platform + + @platform.setter + def platform(self, platform): + """Sets the platform of this Image. + + + :param platform: The platform of this Image. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and platform is None: + raise ValueError("Invalid value for `platform`, must not be `None`") # noqa: E501 + + self._platform = platform + + @property + def size_gib(self): + """Gets the size_gib of this Image. # noqa: E501 + + + :return: The size_gib of this Image. # noqa: E501 + :rtype: int + """ + return self._size_gib + + @size_gib.setter + def size_gib(self, size_gib): + """Sets the size_gib of this Image. + + + :param size_gib: The size_gib of this Image. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and size_gib is None: + raise ValueError("Invalid value for `size_gib`, must not be `None`") # noqa: E501 + + self._size_gib = size_gib + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Image, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Image): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Image): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_api_keys_response.py b/src/cudo_compute/models/list_api_keys_response.py new file mode 100644 index 0000000..3899d66 --- /dev/null +++ b/src/cudo_compute/models/list_api_keys_response.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListApiKeysResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'api_keys': 'list[ApiKey]', + 'page_number': 'int', + 'page_size': 'int', + 'total_count': 'int' + } + + attribute_map = { + 'api_keys': 'apiKeys', + 'page_number': 'pageNumber', + 'page_size': 'pageSize', + 'total_count': 'totalCount' + } + + def __init__(self, api_keys=None, page_number=None, page_size=None, total_count=None, _configuration=None): # noqa: E501 + """ListApiKeysResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._api_keys = None + self._page_number = None + self._page_size = None + self._total_count = None + self.discriminator = None + + self.api_keys = api_keys + self.page_number = page_number + self.page_size = page_size + self.total_count = total_count + + @property + def api_keys(self): + """Gets the api_keys of this ListApiKeysResponse. # noqa: E501 + + + :return: The api_keys of this ListApiKeysResponse. # noqa: E501 + :rtype: list[ApiKey] + """ + return self._api_keys + + @api_keys.setter + def api_keys(self, api_keys): + """Sets the api_keys of this ListApiKeysResponse. + + + :param api_keys: The api_keys of this ListApiKeysResponse. # noqa: E501 + :type: list[ApiKey] + """ + if self._configuration.client_side_validation and api_keys is None: + raise ValueError("Invalid value for `api_keys`, must not be `None`") # noqa: E501 + + self._api_keys = api_keys + + @property + def page_number(self): + """Gets the page_number of this ListApiKeysResponse. # noqa: E501 + + + :return: The page_number of this ListApiKeysResponse. # noqa: E501 + :rtype: int + """ + return self._page_number + + @page_number.setter + def page_number(self, page_number): + """Sets the page_number of this ListApiKeysResponse. + + + :param page_number: The page_number of this ListApiKeysResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_number is None: + raise ValueError("Invalid value for `page_number`, must not be `None`") # noqa: E501 + + self._page_number = page_number + + @property + def page_size(self): + """Gets the page_size of this ListApiKeysResponse. # noqa: E501 + + + :return: The page_size of this ListApiKeysResponse. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this ListApiKeysResponse. + + + :param page_size: The page_size of this ListApiKeysResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_size is None: + raise ValueError("Invalid value for `page_size`, must not be `None`") # noqa: E501 + + self._page_size = page_size + + @property + def total_count(self): + """Gets the total_count of this ListApiKeysResponse. # noqa: E501 + + + :return: The total_count of this ListApiKeysResponse. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this ListApiKeysResponse. + + + :param total_count: The total_count of this ListApiKeysResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListApiKeysResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListApiKeysResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListApiKeysResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_disk_snapshots_response.py b/src/cudo_compute/models/list_disk_snapshots_response.py new file mode 100644 index 0000000..97553ea --- /dev/null +++ b/src/cudo_compute/models/list_disk_snapshots_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListDiskSnapshotsResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'snapshots': 'list[Snapshot]' + } + + attribute_map = { + 'snapshots': 'snapshots' + } + + def __init__(self, snapshots=None, _configuration=None): # noqa: E501 + """ListDiskSnapshotsResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._snapshots = None + self.discriminator = None + + self.snapshots = snapshots + + @property + def snapshots(self): + """Gets the snapshots of this ListDiskSnapshotsResponse. # noqa: E501 + + + :return: The snapshots of this ListDiskSnapshotsResponse. # noqa: E501 + :rtype: list[Snapshot] + """ + return self._snapshots + + @snapshots.setter + def snapshots(self, snapshots): + """Sets the snapshots of this ListDiskSnapshotsResponse. + + + :param snapshots: The snapshots of this ListDiskSnapshotsResponse. # noqa: E501 + :type: list[Snapshot] + """ + if self._configuration.client_side_validation and snapshots is None: + raise ValueError("Invalid value for `snapshots`, must not be `None`") # noqa: E501 + + self._snapshots = snapshots + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListDiskSnapshotsResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListDiskSnapshotsResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListDiskSnapshotsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_disks_response.py b/src/cudo_compute/models/list_disks_response.py new file mode 100644 index 0000000..5c2da11 --- /dev/null +++ b/src/cudo_compute/models/list_disks_response.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListDisksResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'disks': 'list[Disk]', + 'page_number': 'int', + 'page_size': 'int', + 'total_count': 'int' + } + + attribute_map = { + 'disks': 'disks', + 'page_number': 'pageNumber', + 'page_size': 'pageSize', + 'total_count': 'totalCount' + } + + def __init__(self, disks=None, page_number=None, page_size=None, total_count=None, _configuration=None): # noqa: E501 + """ListDisksResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._disks = None + self._page_number = None + self._page_size = None + self._total_count = None + self.discriminator = None + + if disks is not None: + self.disks = disks + self.page_number = page_number + self.page_size = page_size + self.total_count = total_count + + @property + def disks(self): + """Gets the disks of this ListDisksResponse. # noqa: E501 + + + :return: The disks of this ListDisksResponse. # noqa: E501 + :rtype: list[Disk] + """ + return self._disks + + @disks.setter + def disks(self, disks): + """Sets the disks of this ListDisksResponse. + + + :param disks: The disks of this ListDisksResponse. # noqa: E501 + :type: list[Disk] + """ + + self._disks = disks + + @property + def page_number(self): + """Gets the page_number of this ListDisksResponse. # noqa: E501 + + + :return: The page_number of this ListDisksResponse. # noqa: E501 + :rtype: int + """ + return self._page_number + + @page_number.setter + def page_number(self, page_number): + """Sets the page_number of this ListDisksResponse. + + + :param page_number: The page_number of this ListDisksResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_number is None: + raise ValueError("Invalid value for `page_number`, must not be `None`") # noqa: E501 + + self._page_number = page_number + + @property + def page_size(self): + """Gets the page_size of this ListDisksResponse. # noqa: E501 + + + :return: The page_size of this ListDisksResponse. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this ListDisksResponse. + + + :param page_size: The page_size of this ListDisksResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_size is None: + raise ValueError("Invalid value for `page_size`, must not be `None`") # noqa: E501 + + self._page_size = page_size + + @property + def total_count(self): + """Gets the total_count of this ListDisksResponse. # noqa: E501 + + + :return: The total_count of this ListDisksResponse. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this ListDisksResponse. + + + :param total_count: The total_count of this ListDisksResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListDisksResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListDisksResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListDisksResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_networks_response.py b/src/cudo_compute/models/list_networks_response.py new file mode 100644 index 0000000..20e5ebc --- /dev/null +++ b/src/cudo_compute/models/list_networks_response.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListNetworksResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'networks': 'list[Network]', + 'page_number': 'int', + 'page_size': 'int', + 'total_count': 'int' + } + + attribute_map = { + 'networks': 'networks', + 'page_number': 'pageNumber', + 'page_size': 'pageSize', + 'total_count': 'totalCount' + } + + def __init__(self, networks=None, page_number=None, page_size=None, total_count=None, _configuration=None): # noqa: E501 + """ListNetworksResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._networks = None + self._page_number = None + self._page_size = None + self._total_count = None + self.discriminator = None + + self.networks = networks + self.page_number = page_number + self.page_size = page_size + self.total_count = total_count + + @property + def networks(self): + """Gets the networks of this ListNetworksResponse. # noqa: E501 + + + :return: The networks of this ListNetworksResponse. # noqa: E501 + :rtype: list[Network] + """ + return self._networks + + @networks.setter + def networks(self, networks): + """Sets the networks of this ListNetworksResponse. + + + :param networks: The networks of this ListNetworksResponse. # noqa: E501 + :type: list[Network] + """ + if self._configuration.client_side_validation and networks is None: + raise ValueError("Invalid value for `networks`, must not be `None`") # noqa: E501 + + self._networks = networks + + @property + def page_number(self): + """Gets the page_number of this ListNetworksResponse. # noqa: E501 + + + :return: The page_number of this ListNetworksResponse. # noqa: E501 + :rtype: int + """ + return self._page_number + + @page_number.setter + def page_number(self, page_number): + """Sets the page_number of this ListNetworksResponse. + + + :param page_number: The page_number of this ListNetworksResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_number is None: + raise ValueError("Invalid value for `page_number`, must not be `None`") # noqa: E501 + + self._page_number = page_number + + @property + def page_size(self): + """Gets the page_size of this ListNetworksResponse. # noqa: E501 + + + :return: The page_size of this ListNetworksResponse. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this ListNetworksResponse. + + + :param page_size: The page_size of this ListNetworksResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_size is None: + raise ValueError("Invalid value for `page_size`, must not be `None`") # noqa: E501 + + self._page_size = page_size + + @property + def total_count(self): + """Gets the total_count of this ListNetworksResponse. # noqa: E501 + + + :return: The total_count of this ListNetworksResponse. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this ListNetworksResponse. + + + :param total_count: The total_count of this ListNetworksResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListNetworksResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListNetworksResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListNetworksResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_object_storage_buckets_response.py b/src/cudo_compute/models/list_object_storage_buckets_response.py new file mode 100644 index 0000000..8b2ac7f --- /dev/null +++ b/src/cudo_compute/models/list_object_storage_buckets_response.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListObjectStorageBucketsResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'buckets': 'list[ObjectStorageBucket]', + 'page_number': 'int', + 'page_size': 'int', + 'total_count': 'int' + } + + attribute_map = { + 'buckets': 'buckets', + 'page_number': 'pageNumber', + 'page_size': 'pageSize', + 'total_count': 'totalCount' + } + + def __init__(self, buckets=None, page_number=None, page_size=None, total_count=None, _configuration=None): # noqa: E501 + """ListObjectStorageBucketsResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._buckets = None + self._page_number = None + self._page_size = None + self._total_count = None + self.discriminator = None + + self.buckets = buckets + self.page_number = page_number + self.page_size = page_size + self.total_count = total_count + + @property + def buckets(self): + """Gets the buckets of this ListObjectStorageBucketsResponse. # noqa: E501 + + + :return: The buckets of this ListObjectStorageBucketsResponse. # noqa: E501 + :rtype: list[ObjectStorageBucket] + """ + return self._buckets + + @buckets.setter + def buckets(self, buckets): + """Sets the buckets of this ListObjectStorageBucketsResponse. + + + :param buckets: The buckets of this ListObjectStorageBucketsResponse. # noqa: E501 + :type: list[ObjectStorageBucket] + """ + if self._configuration.client_side_validation and buckets is None: + raise ValueError("Invalid value for `buckets`, must not be `None`") # noqa: E501 + + self._buckets = buckets + + @property + def page_number(self): + """Gets the page_number of this ListObjectStorageBucketsResponse. # noqa: E501 + + + :return: The page_number of this ListObjectStorageBucketsResponse. # noqa: E501 + :rtype: int + """ + return self._page_number + + @page_number.setter + def page_number(self, page_number): + """Sets the page_number of this ListObjectStorageBucketsResponse. + + + :param page_number: The page_number of this ListObjectStorageBucketsResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_number is None: + raise ValueError("Invalid value for `page_number`, must not be `None`") # noqa: E501 + + self._page_number = page_number + + @property + def page_size(self): + """Gets the page_size of this ListObjectStorageBucketsResponse. # noqa: E501 + + + :return: The page_size of this ListObjectStorageBucketsResponse. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this ListObjectStorageBucketsResponse. + + + :param page_size: The page_size of this ListObjectStorageBucketsResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_size is None: + raise ValueError("Invalid value for `page_size`, must not be `None`") # noqa: E501 + + self._page_size = page_size + + @property + def total_count(self): + """Gets the total_count of this ListObjectStorageBucketsResponse. # noqa: E501 + + + :return: The total_count of this ListObjectStorageBucketsResponse. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this ListObjectStorageBucketsResponse. + + + :param total_count: The total_count of this ListObjectStorageBucketsResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListObjectStorageBucketsResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListObjectStorageBucketsResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListObjectStorageBucketsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_object_storage_keys_response.py b/src/cudo_compute/models/list_object_storage_keys_response.py new file mode 100644 index 0000000..9c0b9d3 --- /dev/null +++ b/src/cudo_compute/models/list_object_storage_keys_response.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListObjectStorageKeysResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'keys': 'list[ObjectStorageKey]', + 'page_number': 'int', + 'page_size': 'int', + 'total_count': 'int' + } + + attribute_map = { + 'keys': 'keys', + 'page_number': 'pageNumber', + 'page_size': 'pageSize', + 'total_count': 'totalCount' + } + + def __init__(self, keys=None, page_number=None, page_size=None, total_count=None, _configuration=None): # noqa: E501 + """ListObjectStorageKeysResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._keys = None + self._page_number = None + self._page_size = None + self._total_count = None + self.discriminator = None + + self.keys = keys + self.page_number = page_number + self.page_size = page_size + self.total_count = total_count + + @property + def keys(self): + """Gets the keys of this ListObjectStorageKeysResponse. # noqa: E501 + + + :return: The keys of this ListObjectStorageKeysResponse. # noqa: E501 + :rtype: list[ObjectStorageKey] + """ + return self._keys + + @keys.setter + def keys(self, keys): + """Sets the keys of this ListObjectStorageKeysResponse. + + + :param keys: The keys of this ListObjectStorageKeysResponse. # noqa: E501 + :type: list[ObjectStorageKey] + """ + if self._configuration.client_side_validation and keys is None: + raise ValueError("Invalid value for `keys`, must not be `None`") # noqa: E501 + + self._keys = keys + + @property + def page_number(self): + """Gets the page_number of this ListObjectStorageKeysResponse. # noqa: E501 + + + :return: The page_number of this ListObjectStorageKeysResponse. # noqa: E501 + :rtype: int + """ + return self._page_number + + @page_number.setter + def page_number(self, page_number): + """Sets the page_number of this ListObjectStorageKeysResponse. + + + :param page_number: The page_number of this ListObjectStorageKeysResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_number is None: + raise ValueError("Invalid value for `page_number`, must not be `None`") # noqa: E501 + + self._page_number = page_number + + @property + def page_size(self): + """Gets the page_size of this ListObjectStorageKeysResponse. # noqa: E501 + + + :return: The page_size of this ListObjectStorageKeysResponse. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this ListObjectStorageKeysResponse. + + + :param page_size: The page_size of this ListObjectStorageKeysResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_size is None: + raise ValueError("Invalid value for `page_size`, must not be `None`") # noqa: E501 + + self._page_size = page_size + + @property + def total_count(self): + """Gets the total_count of this ListObjectStorageKeysResponse. # noqa: E501 + + + :return: The total_count of this ListObjectStorageKeysResponse. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this ListObjectStorageKeysResponse. + + + :param total_count: The total_count of this ListObjectStorageKeysResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListObjectStorageKeysResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListObjectStorageKeysResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListObjectStorageKeysResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_object_storage_users_response.py b/src/cudo_compute/models/list_object_storage_users_response.py new file mode 100644 index 0000000..1147ea9 --- /dev/null +++ b/src/cudo_compute/models/list_object_storage_users_response.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListObjectStorageUsersResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'page_number': 'int', + 'page_size': 'int', + 'total_count': 'int', + 'users': 'list[ObjectStorageUser]' + } + + attribute_map = { + 'page_number': 'pageNumber', + 'page_size': 'pageSize', + 'total_count': 'totalCount', + 'users': 'users' + } + + def __init__(self, page_number=None, page_size=None, total_count=None, users=None, _configuration=None): # noqa: E501 + """ListObjectStorageUsersResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._page_number = None + self._page_size = None + self._total_count = None + self._users = None + self.discriminator = None + + self.page_number = page_number + self.page_size = page_size + self.total_count = total_count + self.users = users + + @property + def page_number(self): + """Gets the page_number of this ListObjectStorageUsersResponse. # noqa: E501 + + + :return: The page_number of this ListObjectStorageUsersResponse. # noqa: E501 + :rtype: int + """ + return self._page_number + + @page_number.setter + def page_number(self, page_number): + """Sets the page_number of this ListObjectStorageUsersResponse. + + + :param page_number: The page_number of this ListObjectStorageUsersResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_number is None: + raise ValueError("Invalid value for `page_number`, must not be `None`") # noqa: E501 + + self._page_number = page_number + + @property + def page_size(self): + """Gets the page_size of this ListObjectStorageUsersResponse. # noqa: E501 + + + :return: The page_size of this ListObjectStorageUsersResponse. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this ListObjectStorageUsersResponse. + + + :param page_size: The page_size of this ListObjectStorageUsersResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_size is None: + raise ValueError("Invalid value for `page_size`, must not be `None`") # noqa: E501 + + self._page_size = page_size + + @property + def total_count(self): + """Gets the total_count of this ListObjectStorageUsersResponse. # noqa: E501 + + + :return: The total_count of this ListObjectStorageUsersResponse. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this ListObjectStorageUsersResponse. + + + :param total_count: The total_count of this ListObjectStorageUsersResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + @property + def users(self): + """Gets the users of this ListObjectStorageUsersResponse. # noqa: E501 + + + :return: The users of this ListObjectStorageUsersResponse. # noqa: E501 + :rtype: list[ObjectStorageUser] + """ + return self._users + + @users.setter + def users(self, users): + """Sets the users of this ListObjectStorageUsersResponse. + + + :param users: The users of this ListObjectStorageUsersResponse. # noqa: E501 + :type: list[ObjectStorageUser] + """ + if self._configuration.client_side_validation and users is None: + raise ValueError("Invalid value for `users`, must not be `None`") # noqa: E501 + + self._users = users + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListObjectStorageUsersResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListObjectStorageUsersResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListObjectStorageUsersResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_private_vm_images_response.py b/src/cudo_compute/models/list_private_vm_images_response.py new file mode 100644 index 0000000..7d84748 --- /dev/null +++ b/src/cudo_compute/models/list_private_vm_images_response.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListPrivateVMImagesResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'images': 'list[ListPrivateVMImagesResponsePrivateImage]', + 'page_number': 'int', + 'page_size': 'int', + 'total_count': 'int' + } + + attribute_map = { + 'images': 'images', + 'page_number': 'pageNumber', + 'page_size': 'pageSize', + 'total_count': 'totalCount' + } + + def __init__(self, images=None, page_number=None, page_size=None, total_count=None, _configuration=None): # noqa: E501 + """ListPrivateVMImagesResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._images = None + self._page_number = None + self._page_size = None + self._total_count = None + self.discriminator = None + + if images is not None: + self.images = images + self.page_number = page_number + self.page_size = page_size + self.total_count = total_count + + @property + def images(self): + """Gets the images of this ListPrivateVMImagesResponse. # noqa: E501 + + + :return: The images of this ListPrivateVMImagesResponse. # noqa: E501 + :rtype: list[ListPrivateVMImagesResponsePrivateImage] + """ + return self._images + + @images.setter + def images(self, images): + """Sets the images of this ListPrivateVMImagesResponse. + + + :param images: The images of this ListPrivateVMImagesResponse. # noqa: E501 + :type: list[ListPrivateVMImagesResponsePrivateImage] + """ + + self._images = images + + @property + def page_number(self): + """Gets the page_number of this ListPrivateVMImagesResponse. # noqa: E501 + + + :return: The page_number of this ListPrivateVMImagesResponse. # noqa: E501 + :rtype: int + """ + return self._page_number + + @page_number.setter + def page_number(self, page_number): + """Sets the page_number of this ListPrivateVMImagesResponse. + + + :param page_number: The page_number of this ListPrivateVMImagesResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_number is None: + raise ValueError("Invalid value for `page_number`, must not be `None`") # noqa: E501 + + self._page_number = page_number + + @property + def page_size(self): + """Gets the page_size of this ListPrivateVMImagesResponse. # noqa: E501 + + + :return: The page_size of this ListPrivateVMImagesResponse. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this ListPrivateVMImagesResponse. + + + :param page_size: The page_size of this ListPrivateVMImagesResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_size is None: + raise ValueError("Invalid value for `page_size`, must not be `None`") # noqa: E501 + + self._page_size = page_size + + @property + def total_count(self): + """Gets the total_count of this ListPrivateVMImagesResponse. # noqa: E501 + + + :return: The total_count of this ListPrivateVMImagesResponse. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this ListPrivateVMImagesResponse. + + + :param total_count: The total_count of this ListPrivateVMImagesResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListPrivateVMImagesResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListPrivateVMImagesResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListPrivateVMImagesResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_private_vm_images_response_private_image.py b/src/cudo_compute/models/list_private_vm_images_response_private_image.py new file mode 100644 index 0000000..bc11323 --- /dev/null +++ b/src/cudo_compute/models/list_private_vm_images_response_private_image.py @@ -0,0 +1,227 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListPrivateVMImagesResponsePrivateImage(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data_center_id': 'str', + 'description': 'str', + 'id': 'str', + 'project_id': 'str', + 'size_gib': 'int' + } + + attribute_map = { + 'data_center_id': 'dataCenterId', + 'description': 'description', + 'id': 'id', + 'project_id': 'projectId', + 'size_gib': 'sizeGib' + } + + def __init__(self, data_center_id=None, description=None, id=None, project_id=None, size_gib=None, _configuration=None): # noqa: E501 + """ListPrivateVMImagesResponsePrivateImage - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._data_center_id = None + self._description = None + self._id = None + self._project_id = None + self._size_gib = None + self.discriminator = None + + if data_center_id is not None: + self.data_center_id = data_center_id + if description is not None: + self.description = description + if id is not None: + self.id = id + if project_id is not None: + self.project_id = project_id + if size_gib is not None: + self.size_gib = size_gib + + @property + def data_center_id(self): + """Gets the data_center_id of this ListPrivateVMImagesResponsePrivateImage. # noqa: E501 + + + :return: The data_center_id of this ListPrivateVMImagesResponsePrivateImage. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this ListPrivateVMImagesResponsePrivateImage. + + + :param data_center_id: The data_center_id of this ListPrivateVMImagesResponsePrivateImage. # noqa: E501 + :type: str + """ + + self._data_center_id = data_center_id + + @property + def description(self): + """Gets the description of this ListPrivateVMImagesResponsePrivateImage. # noqa: E501 + + + :return: The description of this ListPrivateVMImagesResponsePrivateImage. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this ListPrivateVMImagesResponsePrivateImage. + + + :param description: The description of this ListPrivateVMImagesResponsePrivateImage. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def id(self): + """Gets the id of this ListPrivateVMImagesResponsePrivateImage. # noqa: E501 + + + :return: The id of this ListPrivateVMImagesResponsePrivateImage. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ListPrivateVMImagesResponsePrivateImage. + + + :param id: The id of this ListPrivateVMImagesResponsePrivateImage. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def project_id(self): + """Gets the project_id of this ListPrivateVMImagesResponsePrivateImage. # noqa: E501 + + + :return: The project_id of this ListPrivateVMImagesResponsePrivateImage. # noqa: E501 + :rtype: str + """ + return self._project_id + + @project_id.setter + def project_id(self, project_id): + """Sets the project_id of this ListPrivateVMImagesResponsePrivateImage. + + + :param project_id: The project_id of this ListPrivateVMImagesResponsePrivateImage. # noqa: E501 + :type: str + """ + + self._project_id = project_id + + @property + def size_gib(self): + """Gets the size_gib of this ListPrivateVMImagesResponsePrivateImage. # noqa: E501 + + + :return: The size_gib of this ListPrivateVMImagesResponsePrivateImage. # noqa: E501 + :rtype: int + """ + return self._size_gib + + @size_gib.setter + def size_gib(self, size_gib): + """Sets the size_gib of this ListPrivateVMImagesResponsePrivateImage. + + + :param size_gib: The size_gib of this ListPrivateVMImagesResponsePrivateImage. # noqa: E501 + :type: int + """ + + self._size_gib = size_gib + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListPrivateVMImagesResponsePrivateImage, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListPrivateVMImagesResponsePrivateImage): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListPrivateVMImagesResponsePrivateImage): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_project_ssh_keys_response.py b/src/cudo_compute/models/list_project_ssh_keys_response.py new file mode 100644 index 0000000..c8408a4 --- /dev/null +++ b/src/cudo_compute/models/list_project_ssh_keys_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListProjectSshKeysResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'ssh_keys': 'list[SshKey]' + } + + attribute_map = { + 'ssh_keys': 'sshKeys' + } + + def __init__(self, ssh_keys=None, _configuration=None): # noqa: E501 + """ListProjectSshKeysResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._ssh_keys = None + self.discriminator = None + + self.ssh_keys = ssh_keys + + @property + def ssh_keys(self): + """Gets the ssh_keys of this ListProjectSshKeysResponse. # noqa: E501 + + + :return: The ssh_keys of this ListProjectSshKeysResponse. # noqa: E501 + :rtype: list[SshKey] + """ + return self._ssh_keys + + @ssh_keys.setter + def ssh_keys(self, ssh_keys): + """Sets the ssh_keys of this ListProjectSshKeysResponse. + + + :param ssh_keys: The ssh_keys of this ListProjectSshKeysResponse. # noqa: E501 + :type: list[SshKey] + """ + if self._configuration.client_side_validation and ssh_keys is None: + raise ValueError("Invalid value for `ssh_keys`, must not be `None`") # noqa: E501 + + self._ssh_keys = ssh_keys + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListProjectSshKeysResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListProjectSshKeysResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListProjectSshKeysResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_projects_response.py b/src/cudo_compute/models/list_projects_response.py new file mode 100644 index 0000000..81d5ac9 --- /dev/null +++ b/src/cudo_compute/models/list_projects_response.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListProjectsResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'page_size': 'int', + 'page_token': 'str', + 'projects': 'list[Project]' + } + + attribute_map = { + 'page_size': 'pageSize', + 'page_token': 'pageToken', + 'projects': 'projects' + } + + def __init__(self, page_size=None, page_token=None, projects=None, _configuration=None): # noqa: E501 + """ListProjectsResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._page_size = None + self._page_token = None + self._projects = None + self.discriminator = None + + self.page_size = page_size + self.page_token = page_token + self.projects = projects + + @property + def page_size(self): + """Gets the page_size of this ListProjectsResponse. # noqa: E501 + + + :return: The page_size of this ListProjectsResponse. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this ListProjectsResponse. + + + :param page_size: The page_size of this ListProjectsResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_size is None: + raise ValueError("Invalid value for `page_size`, must not be `None`") # noqa: E501 + + self._page_size = page_size + + @property + def page_token(self): + """Gets the page_token of this ListProjectsResponse. # noqa: E501 + + + :return: The page_token of this ListProjectsResponse. # noqa: E501 + :rtype: str + """ + return self._page_token + + @page_token.setter + def page_token(self, page_token): + """Sets the page_token of this ListProjectsResponse. + + + :param page_token: The page_token of this ListProjectsResponse. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and page_token is None: + raise ValueError("Invalid value for `page_token`, must not be `None`") # noqa: E501 + + self._page_token = page_token + + @property + def projects(self): + """Gets the projects of this ListProjectsResponse. # noqa: E501 + + + :return: The projects of this ListProjectsResponse. # noqa: E501 + :rtype: list[Project] + """ + return self._projects + + @projects.setter + def projects(self, projects): + """Sets the projects of this ListProjectsResponse. + + + :param projects: The projects of this ListProjectsResponse. # noqa: E501 + :type: list[Project] + """ + if self._configuration.client_side_validation and projects is None: + raise ValueError("Invalid value for `projects`, must not be `None`") # noqa: E501 + + self._projects = projects + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListProjectsResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListProjectsResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListProjectsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_public_vm_images_response.py b/src/cudo_compute/models/list_public_vm_images_response.py new file mode 100644 index 0000000..ffcb617 --- /dev/null +++ b/src/cudo_compute/models/list_public_vm_images_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListPublicVMImagesResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'images': 'list[Image]' + } + + attribute_map = { + 'images': 'images' + } + + def __init__(self, images=None, _configuration=None): # noqa: E501 + """ListPublicVMImagesResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._images = None + self.discriminator = None + + self.images = images + + @property + def images(self): + """Gets the images of this ListPublicVMImagesResponse. # noqa: E501 + + + :return: The images of this ListPublicVMImagesResponse. # noqa: E501 + :rtype: list[Image] + """ + return self._images + + @images.setter + def images(self, images): + """Sets the images of this ListPublicVMImagesResponse. + + + :param images: The images of this ListPublicVMImagesResponse. # noqa: E501 + :type: list[Image] + """ + if self._configuration.client_side_validation and images is None: + raise ValueError("Invalid value for `images`, must not be `None`") # noqa: E501 + + self._images = images + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListPublicVMImagesResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListPublicVMImagesResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListPublicVMImagesResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_regions_response.py b/src/cudo_compute/models/list_regions_response.py new file mode 100644 index 0000000..c7d8503 --- /dev/null +++ b/src/cudo_compute/models/list_regions_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListRegionsResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'regions': 'list[Region]' + } + + attribute_map = { + 'regions': 'regions' + } + + def __init__(self, regions=None, _configuration=None): # noqa: E501 + """ListRegionsResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._regions = None + self.discriminator = None + + self.regions = regions + + @property + def regions(self): + """Gets the regions of this ListRegionsResponse. # noqa: E501 + + + :return: The regions of this ListRegionsResponse. # noqa: E501 + :rtype: list[Region] + """ + return self._regions + + @regions.setter + def regions(self, regions): + """Sets the regions of this ListRegionsResponse. + + + :param regions: The regions of this ListRegionsResponse. # noqa: E501 + :type: list[Region] + """ + if self._configuration.client_side_validation and regions is None: + raise ValueError("Invalid value for `regions`, must not be `None`") # noqa: E501 + + self._regions = regions + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListRegionsResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListRegionsResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListRegionsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_security_groups_response.py b/src/cudo_compute/models/list_security_groups_response.py new file mode 100644 index 0000000..f2409a8 --- /dev/null +++ b/src/cudo_compute/models/list_security_groups_response.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListSecurityGroupsResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'page_number': 'int', + 'page_size': 'int', + 'security_groups': 'list[SecurityGroup]', + 'total_count': 'int' + } + + attribute_map = { + 'page_number': 'pageNumber', + 'page_size': 'pageSize', + 'security_groups': 'securityGroups', + 'total_count': 'totalCount' + } + + def __init__(self, page_number=None, page_size=None, security_groups=None, total_count=None, _configuration=None): # noqa: E501 + """ListSecurityGroupsResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._page_number = None + self._page_size = None + self._security_groups = None + self._total_count = None + self.discriminator = None + + self.page_number = page_number + self.page_size = page_size + self.security_groups = security_groups + self.total_count = total_count + + @property + def page_number(self): + """Gets the page_number of this ListSecurityGroupsResponse. # noqa: E501 + + + :return: The page_number of this ListSecurityGroupsResponse. # noqa: E501 + :rtype: int + """ + return self._page_number + + @page_number.setter + def page_number(self, page_number): + """Sets the page_number of this ListSecurityGroupsResponse. + + + :param page_number: The page_number of this ListSecurityGroupsResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_number is None: + raise ValueError("Invalid value for `page_number`, must not be `None`") # noqa: E501 + + self._page_number = page_number + + @property + def page_size(self): + """Gets the page_size of this ListSecurityGroupsResponse. # noqa: E501 + + + :return: The page_size of this ListSecurityGroupsResponse. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this ListSecurityGroupsResponse. + + + :param page_size: The page_size of this ListSecurityGroupsResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_size is None: + raise ValueError("Invalid value for `page_size`, must not be `None`") # noqa: E501 + + self._page_size = page_size + + @property + def security_groups(self): + """Gets the security_groups of this ListSecurityGroupsResponse. # noqa: E501 + + + :return: The security_groups of this ListSecurityGroupsResponse. # noqa: E501 + :rtype: list[SecurityGroup] + """ + return self._security_groups + + @security_groups.setter + def security_groups(self, security_groups): + """Sets the security_groups of this ListSecurityGroupsResponse. + + + :param security_groups: The security_groups of this ListSecurityGroupsResponse. # noqa: E501 + :type: list[SecurityGroup] + """ + if self._configuration.client_side_validation and security_groups is None: + raise ValueError("Invalid value for `security_groups`, must not be `None`") # noqa: E501 + + self._security_groups = security_groups + + @property + def total_count(self): + """Gets the total_count of this ListSecurityGroupsResponse. # noqa: E501 + + + :return: The total_count of this ListSecurityGroupsResponse. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this ListSecurityGroupsResponse. + + + :param total_count: The total_count of this ListSecurityGroupsResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListSecurityGroupsResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListSecurityGroupsResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListSecurityGroupsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_ssh_keys_response.py b/src/cudo_compute/models/list_ssh_keys_response.py new file mode 100644 index 0000000..9055faa --- /dev/null +++ b/src/cudo_compute/models/list_ssh_keys_response.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListSshKeysResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'page_number': 'int', + 'page_size': 'int', + 'ssh_keys': 'list[SshKey]', + 'total_count': 'int' + } + + attribute_map = { + 'page_number': 'pageNumber', + 'page_size': 'pageSize', + 'ssh_keys': 'sshKeys', + 'total_count': 'totalCount' + } + + def __init__(self, page_number=None, page_size=None, ssh_keys=None, total_count=None, _configuration=None): # noqa: E501 + """ListSshKeysResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._page_number = None + self._page_size = None + self._ssh_keys = None + self._total_count = None + self.discriminator = None + + self.page_number = page_number + self.page_size = page_size + self.ssh_keys = ssh_keys + self.total_count = total_count + + @property + def page_number(self): + """Gets the page_number of this ListSshKeysResponse. # noqa: E501 + + + :return: The page_number of this ListSshKeysResponse. # noqa: E501 + :rtype: int + """ + return self._page_number + + @page_number.setter + def page_number(self, page_number): + """Sets the page_number of this ListSshKeysResponse. + + + :param page_number: The page_number of this ListSshKeysResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_number is None: + raise ValueError("Invalid value for `page_number`, must not be `None`") # noqa: E501 + + self._page_number = page_number + + @property + def page_size(self): + """Gets the page_size of this ListSshKeysResponse. # noqa: E501 + + + :return: The page_size of this ListSshKeysResponse. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this ListSshKeysResponse. + + + :param page_size: The page_size of this ListSshKeysResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and page_size is None: + raise ValueError("Invalid value for `page_size`, must not be `None`") # noqa: E501 + + self._page_size = page_size + + @property + def ssh_keys(self): + """Gets the ssh_keys of this ListSshKeysResponse. # noqa: E501 + + + :return: The ssh_keys of this ListSshKeysResponse. # noqa: E501 + :rtype: list[SshKey] + """ + return self._ssh_keys + + @ssh_keys.setter + def ssh_keys(self, ssh_keys): + """Sets the ssh_keys of this ListSshKeysResponse. + + + :param ssh_keys: The ssh_keys of this ListSshKeysResponse. # noqa: E501 + :type: list[SshKey] + """ + if self._configuration.client_side_validation and ssh_keys is None: + raise ValueError("Invalid value for `ssh_keys`, must not be `None`") # noqa: E501 + + self._ssh_keys = ssh_keys + + @property + def total_count(self): + """Gets the total_count of this ListSshKeysResponse. # noqa: E501 + + + :return: The total_count of this ListSshKeysResponse. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this ListSshKeysResponse. + + + :param total_count: The total_count of this ListSshKeysResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListSshKeysResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListSshKeysResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListSshKeysResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_user_permissions_response.py b/src/cudo_compute/models/list_user_permissions_response.py new file mode 100644 index 0000000..5a929bf --- /dev/null +++ b/src/cudo_compute/models/list_user_permissions_response.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListUserPermissionsResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'billing_account_permissions': 'list[UserPermission]', + 'data_center_permissions': 'list[UserPermission]', + 'project_permissions': 'list[UserPermission]' + } + + attribute_map = { + 'billing_account_permissions': 'billingAccountPermissions', + 'data_center_permissions': 'dataCenterPermissions', + 'project_permissions': 'projectPermissions' + } + + def __init__(self, billing_account_permissions=None, data_center_permissions=None, project_permissions=None, _configuration=None): # noqa: E501 + """ListUserPermissionsResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._billing_account_permissions = None + self._data_center_permissions = None + self._project_permissions = None + self.discriminator = None + + self.billing_account_permissions = billing_account_permissions + self.data_center_permissions = data_center_permissions + self.project_permissions = project_permissions + + @property + def billing_account_permissions(self): + """Gets the billing_account_permissions of this ListUserPermissionsResponse. # noqa: E501 + + + :return: The billing_account_permissions of this ListUserPermissionsResponse. # noqa: E501 + :rtype: list[UserPermission] + """ + return self._billing_account_permissions + + @billing_account_permissions.setter + def billing_account_permissions(self, billing_account_permissions): + """Sets the billing_account_permissions of this ListUserPermissionsResponse. + + + :param billing_account_permissions: The billing_account_permissions of this ListUserPermissionsResponse. # noqa: E501 + :type: list[UserPermission] + """ + if self._configuration.client_side_validation and billing_account_permissions is None: + raise ValueError("Invalid value for `billing_account_permissions`, must not be `None`") # noqa: E501 + + self._billing_account_permissions = billing_account_permissions + + @property + def data_center_permissions(self): + """Gets the data_center_permissions of this ListUserPermissionsResponse. # noqa: E501 + + + :return: The data_center_permissions of this ListUserPermissionsResponse. # noqa: E501 + :rtype: list[UserPermission] + """ + return self._data_center_permissions + + @data_center_permissions.setter + def data_center_permissions(self, data_center_permissions): + """Sets the data_center_permissions of this ListUserPermissionsResponse. + + + :param data_center_permissions: The data_center_permissions of this ListUserPermissionsResponse. # noqa: E501 + :type: list[UserPermission] + """ + if self._configuration.client_side_validation and data_center_permissions is None: + raise ValueError("Invalid value for `data_center_permissions`, must not be `None`") # noqa: E501 + + self._data_center_permissions = data_center_permissions + + @property + def project_permissions(self): + """Gets the project_permissions of this ListUserPermissionsResponse. # noqa: E501 + + + :return: The project_permissions of this ListUserPermissionsResponse. # noqa: E501 + :rtype: list[UserPermission] + """ + return self._project_permissions + + @project_permissions.setter + def project_permissions(self, project_permissions): + """Sets the project_permissions of this ListUserPermissionsResponse. + + + :param project_permissions: The project_permissions of this ListUserPermissionsResponse. # noqa: E501 + :type: list[UserPermission] + """ + if self._configuration.client_side_validation and project_permissions is None: + raise ValueError("Invalid value for `project_permissions`, must not be `None`") # noqa: E501 + + self._project_permissions = project_permissions + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListUserPermissionsResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListUserPermissionsResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListUserPermissionsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_vm_data_centers_response.py b/src/cudo_compute/models/list_vm_data_centers_response.py new file mode 100644 index 0000000..6ca5ab2 --- /dev/null +++ b/src/cudo_compute/models/list_vm_data_centers_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListVMDataCentersResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data_centers': 'list[VMDataCenter]' + } + + attribute_map = { + 'data_centers': 'dataCenters' + } + + def __init__(self, data_centers=None, _configuration=None): # noqa: E501 + """ListVMDataCentersResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._data_centers = None + self.discriminator = None + + self.data_centers = data_centers + + @property + def data_centers(self): + """Gets the data_centers of this ListVMDataCentersResponse. # noqa: E501 + + + :return: The data_centers of this ListVMDataCentersResponse. # noqa: E501 + :rtype: list[VMDataCenter] + """ + return self._data_centers + + @data_centers.setter + def data_centers(self, data_centers): + """Sets the data_centers of this ListVMDataCentersResponse. + + + :param data_centers: The data_centers of this ListVMDataCentersResponse. # noqa: E501 + :type: list[VMDataCenter] + """ + if self._configuration.client_side_validation and data_centers is None: + raise ValueError("Invalid value for `data_centers`, must not be `None`") # noqa: E501 + + self._data_centers = data_centers + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListVMDataCentersResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListVMDataCentersResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListVMDataCentersResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_vm_disks_response.py b/src/cudo_compute/models/list_vm_disks_response.py new file mode 100644 index 0000000..16ab589 --- /dev/null +++ b/src/cudo_compute/models/list_vm_disks_response.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListVMDisksResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'disks': 'list[Disk]' + } + + attribute_map = { + 'disks': 'disks' + } + + def __init__(self, disks=None, _configuration=None): # noqa: E501 + """ListVMDisksResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._disks = None + self.discriminator = None + + if disks is not None: + self.disks = disks + + @property + def disks(self): + """Gets the disks of this ListVMDisksResponse. # noqa: E501 + + + :return: The disks of this ListVMDisksResponse. # noqa: E501 + :rtype: list[Disk] + """ + return self._disks + + @disks.setter + def disks(self, disks): + """Sets the disks of this ListVMDisksResponse. + + + :param disks: The disks of this ListVMDisksResponse. # noqa: E501 + :type: list[Disk] + """ + + self._disks = disks + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListVMDisksResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListVMDisksResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListVMDisksResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_vm_machine_types_request.py b/src/cudo_compute/models/list_vm_machine_types_request.py new file mode 100644 index 0000000..bcb1be6 --- /dev/null +++ b/src/cudo_compute/models/list_vm_machine_types_request.py @@ -0,0 +1,411 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListVMMachineTypesRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'cpu_model': 'str', + 'data_center_id': 'str', + 'gpu': 'int', + 'gpu_model': 'str', + 'memory_gib': 'int', + 'order_by': 'str', + 'page_number': 'int', + 'page_size': 'int', + 'public_ipv4': 'bool', + 'region_id': 'str', + 'storage_gib': 'int', + 'vcpu': 'int' + } + + attribute_map = { + 'cpu_model': 'cpuModel', + 'data_center_id': 'dataCenterId', + 'gpu': 'gpu', + 'gpu_model': 'gpuModel', + 'memory_gib': 'memoryGib', + 'order_by': 'orderBy', + 'page_number': 'pageNumber', + 'page_size': 'pageSize', + 'public_ipv4': 'publicIpv4', + 'region_id': 'regionId', + 'storage_gib': 'storageGib', + 'vcpu': 'vcpu' + } + + def __init__(self, cpu_model=None, data_center_id=None, gpu=None, gpu_model=None, memory_gib=None, order_by=None, page_number=None, page_size=None, public_ipv4=None, region_id=None, storage_gib=None, vcpu=None, _configuration=None): # noqa: E501 + """ListVMMachineTypesRequest - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._cpu_model = None + self._data_center_id = None + self._gpu = None + self._gpu_model = None + self._memory_gib = None + self._order_by = None + self._page_number = None + self._page_size = None + self._public_ipv4 = None + self._region_id = None + self._storage_gib = None + self._vcpu = None + self.discriminator = None + + if cpu_model is not None: + self.cpu_model = cpu_model + if data_center_id is not None: + self.data_center_id = data_center_id + if gpu is not None: + self.gpu = gpu + if gpu_model is not None: + self.gpu_model = gpu_model + self.memory_gib = memory_gib + if order_by is not None: + self.order_by = order_by + if page_number is not None: + self.page_number = page_number + if page_size is not None: + self.page_size = page_size + if public_ipv4 is not None: + self.public_ipv4 = public_ipv4 + if region_id is not None: + self.region_id = region_id + if storage_gib is not None: + self.storage_gib = storage_gib + self.vcpu = vcpu + + @property + def cpu_model(self): + """Gets the cpu_model of this ListVMMachineTypesRequest. # noqa: E501 + + + :return: The cpu_model of this ListVMMachineTypesRequest. # noqa: E501 + :rtype: str + """ + return self._cpu_model + + @cpu_model.setter + def cpu_model(self, cpu_model): + """Sets the cpu_model of this ListVMMachineTypesRequest. + + + :param cpu_model: The cpu_model of this ListVMMachineTypesRequest. # noqa: E501 + :type: str + """ + + self._cpu_model = cpu_model + + @property + def data_center_id(self): + """Gets the data_center_id of this ListVMMachineTypesRequest. # noqa: E501 + + + :return: The data_center_id of this ListVMMachineTypesRequest. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this ListVMMachineTypesRequest. + + + :param data_center_id: The data_center_id of this ListVMMachineTypesRequest. # noqa: E501 + :type: str + """ + + self._data_center_id = data_center_id + + @property + def gpu(self): + """Gets the gpu of this ListVMMachineTypesRequest. # noqa: E501 + + + :return: The gpu of this ListVMMachineTypesRequest. # noqa: E501 + :rtype: int + """ + return self._gpu + + @gpu.setter + def gpu(self, gpu): + """Sets the gpu of this ListVMMachineTypesRequest. + + + :param gpu: The gpu of this ListVMMachineTypesRequest. # noqa: E501 + :type: int + """ + + self._gpu = gpu + + @property + def gpu_model(self): + """Gets the gpu_model of this ListVMMachineTypesRequest. # noqa: E501 + + + :return: The gpu_model of this ListVMMachineTypesRequest. # noqa: E501 + :rtype: str + """ + return self._gpu_model + + @gpu_model.setter + def gpu_model(self, gpu_model): + """Sets the gpu_model of this ListVMMachineTypesRequest. + + + :param gpu_model: The gpu_model of this ListVMMachineTypesRequest. # noqa: E501 + :type: str + """ + + self._gpu_model = gpu_model + + @property + def memory_gib(self): + """Gets the memory_gib of this ListVMMachineTypesRequest. # noqa: E501 + + + :return: The memory_gib of this ListVMMachineTypesRequest. # noqa: E501 + :rtype: int + """ + return self._memory_gib + + @memory_gib.setter + def memory_gib(self, memory_gib): + """Sets the memory_gib of this ListVMMachineTypesRequest. + + + :param memory_gib: The memory_gib of this ListVMMachineTypesRequest. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and memory_gib is None: + raise ValueError("Invalid value for `memory_gib`, must not be `None`") # noqa: E501 + + self._memory_gib = memory_gib + + @property + def order_by(self): + """Gets the order_by of this ListVMMachineTypesRequest. # noqa: E501 + + + :return: The order_by of this ListVMMachineTypesRequest. # noqa: E501 + :rtype: str + """ + return self._order_by + + @order_by.setter + def order_by(self, order_by): + """Sets the order_by of this ListVMMachineTypesRequest. + + + :param order_by: The order_by of this ListVMMachineTypesRequest. # noqa: E501 + :type: str + """ + + self._order_by = order_by + + @property + def page_number(self): + """Gets the page_number of this ListVMMachineTypesRequest. # noqa: E501 + + + :return: The page_number of this ListVMMachineTypesRequest. # noqa: E501 + :rtype: int + """ + return self._page_number + + @page_number.setter + def page_number(self, page_number): + """Sets the page_number of this ListVMMachineTypesRequest. + + + :param page_number: The page_number of this ListVMMachineTypesRequest. # noqa: E501 + :type: int + """ + + self._page_number = page_number + + @property + def page_size(self): + """Gets the page_size of this ListVMMachineTypesRequest. # noqa: E501 + + + :return: The page_size of this ListVMMachineTypesRequest. # noqa: E501 + :rtype: int + """ + return self._page_size + + @page_size.setter + def page_size(self, page_size): + """Sets the page_size of this ListVMMachineTypesRequest. + + + :param page_size: The page_size of this ListVMMachineTypesRequest. # noqa: E501 + :type: int + """ + + self._page_size = page_size + + @property + def public_ipv4(self): + """Gets the public_ipv4 of this ListVMMachineTypesRequest. # noqa: E501 + + + :return: The public_ipv4 of this ListVMMachineTypesRequest. # noqa: E501 + :rtype: bool + """ + return self._public_ipv4 + + @public_ipv4.setter + def public_ipv4(self, public_ipv4): + """Sets the public_ipv4 of this ListVMMachineTypesRequest. + + + :param public_ipv4: The public_ipv4 of this ListVMMachineTypesRequest. # noqa: E501 + :type: bool + """ + + self._public_ipv4 = public_ipv4 + + @property + def region_id(self): + """Gets the region_id of this ListVMMachineTypesRequest. # noqa: E501 + + + :return: The region_id of this ListVMMachineTypesRequest. # noqa: E501 + :rtype: str + """ + return self._region_id + + @region_id.setter + def region_id(self, region_id): + """Sets the region_id of this ListVMMachineTypesRequest. + + + :param region_id: The region_id of this ListVMMachineTypesRequest. # noqa: E501 + :type: str + """ + + self._region_id = region_id + + @property + def storage_gib(self): + """Gets the storage_gib of this ListVMMachineTypesRequest. # noqa: E501 + + + :return: The storage_gib of this ListVMMachineTypesRequest. # noqa: E501 + :rtype: int + """ + return self._storage_gib + + @storage_gib.setter + def storage_gib(self, storage_gib): + """Sets the storage_gib of this ListVMMachineTypesRequest. + + + :param storage_gib: The storage_gib of this ListVMMachineTypesRequest. # noqa: E501 + :type: int + """ + + self._storage_gib = storage_gib + + @property + def vcpu(self): + """Gets the vcpu of this ListVMMachineTypesRequest. # noqa: E501 + + + :return: The vcpu of this ListVMMachineTypesRequest. # noqa: E501 + :rtype: int + """ + return self._vcpu + + @vcpu.setter + def vcpu(self, vcpu): + """Sets the vcpu of this ListVMMachineTypesRequest. + + + :param vcpu: The vcpu of this ListVMMachineTypesRequest. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and vcpu is None: + raise ValueError("Invalid value for `vcpu`, must not be `None`") # noqa: E501 + + self._vcpu = vcpu + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListVMMachineTypesRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListVMMachineTypesRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListVMMachineTypesRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_vm_machine_types_response.py b/src/cudo_compute/models/list_vm_machine_types_response.py new file mode 100644 index 0000000..092a403 --- /dev/null +++ b/src/cudo_compute/models/list_vm_machine_types_response.py @@ -0,0 +1,340 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListVMMachineTypesResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'count_vm_available': 'int', + 'cpu_models': 'list[CpuModelCategory]', + 'data_centers': 'list[DataCenterCategory]', + 'gpu_models': 'list[GpuModelCategory]', + 'host_configs': 'list[HostConfigCategory]', + 'max_gpu': 'int', + 'max_memory_gib': 'int', + 'max_vcpu': 'int', + 'request': 'ListVMMachineTypesRequest' + } + + attribute_map = { + 'count_vm_available': 'countVmAvailable', + 'cpu_models': 'cpuModels', + 'data_centers': 'dataCenters', + 'gpu_models': 'gpuModels', + 'host_configs': 'hostConfigs', + 'max_gpu': 'maxGpu', + 'max_memory_gib': 'maxMemoryGib', + 'max_vcpu': 'maxVcpu', + 'request': 'request' + } + + def __init__(self, count_vm_available=None, cpu_models=None, data_centers=None, gpu_models=None, host_configs=None, max_gpu=None, max_memory_gib=None, max_vcpu=None, request=None, _configuration=None): # noqa: E501 + """ListVMMachineTypesResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._count_vm_available = None + self._cpu_models = None + self._data_centers = None + self._gpu_models = None + self._host_configs = None + self._max_gpu = None + self._max_memory_gib = None + self._max_vcpu = None + self._request = None + self.discriminator = None + + self.count_vm_available = count_vm_available + self.cpu_models = cpu_models + self.data_centers = data_centers + self.gpu_models = gpu_models + self.host_configs = host_configs + self.max_gpu = max_gpu + self.max_memory_gib = max_memory_gib + self.max_vcpu = max_vcpu + self.request = request + + @property + def count_vm_available(self): + """Gets the count_vm_available of this ListVMMachineTypesResponse. # noqa: E501 + + + :return: The count_vm_available of this ListVMMachineTypesResponse. # noqa: E501 + :rtype: int + """ + return self._count_vm_available + + @count_vm_available.setter + def count_vm_available(self, count_vm_available): + """Sets the count_vm_available of this ListVMMachineTypesResponse. + + + :param count_vm_available: The count_vm_available of this ListVMMachineTypesResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and count_vm_available is None: + raise ValueError("Invalid value for `count_vm_available`, must not be `None`") # noqa: E501 + + self._count_vm_available = count_vm_available + + @property + def cpu_models(self): + """Gets the cpu_models of this ListVMMachineTypesResponse. # noqa: E501 + + + :return: The cpu_models of this ListVMMachineTypesResponse. # noqa: E501 + :rtype: list[CpuModelCategory] + """ + return self._cpu_models + + @cpu_models.setter + def cpu_models(self, cpu_models): + """Sets the cpu_models of this ListVMMachineTypesResponse. + + + :param cpu_models: The cpu_models of this ListVMMachineTypesResponse. # noqa: E501 + :type: list[CpuModelCategory] + """ + if self._configuration.client_side_validation and cpu_models is None: + raise ValueError("Invalid value for `cpu_models`, must not be `None`") # noqa: E501 + + self._cpu_models = cpu_models + + @property + def data_centers(self): + """Gets the data_centers of this ListVMMachineTypesResponse. # noqa: E501 + + + :return: The data_centers of this ListVMMachineTypesResponse. # noqa: E501 + :rtype: list[DataCenterCategory] + """ + return self._data_centers + + @data_centers.setter + def data_centers(self, data_centers): + """Sets the data_centers of this ListVMMachineTypesResponse. + + + :param data_centers: The data_centers of this ListVMMachineTypesResponse. # noqa: E501 + :type: list[DataCenterCategory] + """ + if self._configuration.client_side_validation and data_centers is None: + raise ValueError("Invalid value for `data_centers`, must not be `None`") # noqa: E501 + + self._data_centers = data_centers + + @property + def gpu_models(self): + """Gets the gpu_models of this ListVMMachineTypesResponse. # noqa: E501 + + + :return: The gpu_models of this ListVMMachineTypesResponse. # noqa: E501 + :rtype: list[GpuModelCategory] + """ + return self._gpu_models + + @gpu_models.setter + def gpu_models(self, gpu_models): + """Sets the gpu_models of this ListVMMachineTypesResponse. + + + :param gpu_models: The gpu_models of this ListVMMachineTypesResponse. # noqa: E501 + :type: list[GpuModelCategory] + """ + if self._configuration.client_side_validation and gpu_models is None: + raise ValueError("Invalid value for `gpu_models`, must not be `None`") # noqa: E501 + + self._gpu_models = gpu_models + + @property + def host_configs(self): + """Gets the host_configs of this ListVMMachineTypesResponse. # noqa: E501 + + + :return: The host_configs of this ListVMMachineTypesResponse. # noqa: E501 + :rtype: list[HostConfigCategory] + """ + return self._host_configs + + @host_configs.setter + def host_configs(self, host_configs): + """Sets the host_configs of this ListVMMachineTypesResponse. + + + :param host_configs: The host_configs of this ListVMMachineTypesResponse. # noqa: E501 + :type: list[HostConfigCategory] + """ + if self._configuration.client_side_validation and host_configs is None: + raise ValueError("Invalid value for `host_configs`, must not be `None`") # noqa: E501 + + self._host_configs = host_configs + + @property + def max_gpu(self): + """Gets the max_gpu of this ListVMMachineTypesResponse. # noqa: E501 + + + :return: The max_gpu of this ListVMMachineTypesResponse. # noqa: E501 + :rtype: int + """ + return self._max_gpu + + @max_gpu.setter + def max_gpu(self, max_gpu): + """Sets the max_gpu of this ListVMMachineTypesResponse. + + + :param max_gpu: The max_gpu of this ListVMMachineTypesResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and max_gpu is None: + raise ValueError("Invalid value for `max_gpu`, must not be `None`") # noqa: E501 + + self._max_gpu = max_gpu + + @property + def max_memory_gib(self): + """Gets the max_memory_gib of this ListVMMachineTypesResponse. # noqa: E501 + + + :return: The max_memory_gib of this ListVMMachineTypesResponse. # noqa: E501 + :rtype: int + """ + return self._max_memory_gib + + @max_memory_gib.setter + def max_memory_gib(self, max_memory_gib): + """Sets the max_memory_gib of this ListVMMachineTypesResponse. + + + :param max_memory_gib: The max_memory_gib of this ListVMMachineTypesResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and max_memory_gib is None: + raise ValueError("Invalid value for `max_memory_gib`, must not be `None`") # noqa: E501 + + self._max_memory_gib = max_memory_gib + + @property + def max_vcpu(self): + """Gets the max_vcpu of this ListVMMachineTypesResponse. # noqa: E501 + + + :return: The max_vcpu of this ListVMMachineTypesResponse. # noqa: E501 + :rtype: int + """ + return self._max_vcpu + + @max_vcpu.setter + def max_vcpu(self, max_vcpu): + """Sets the max_vcpu of this ListVMMachineTypesResponse. + + + :param max_vcpu: The max_vcpu of this ListVMMachineTypesResponse. # noqa: E501 + :type: int + """ + if self._configuration.client_side_validation and max_vcpu is None: + raise ValueError("Invalid value for `max_vcpu`, must not be `None`") # noqa: E501 + + self._max_vcpu = max_vcpu + + @property + def request(self): + """Gets the request of this ListVMMachineTypesResponse. # noqa: E501 + + + :return: The request of this ListVMMachineTypesResponse. # noqa: E501 + :rtype: ListVMMachineTypesRequest + """ + return self._request + + @request.setter + def request(self, request): + """Sets the request of this ListVMMachineTypesResponse. + + + :param request: The request of this ListVMMachineTypesResponse. # noqa: E501 + :type: ListVMMachineTypesRequest + """ + if self._configuration.client_side_validation and request is None: + raise ValueError("Invalid value for `request`, must not be `None`") # noqa: E501 + + self._request = request + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListVMMachineTypesResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListVMMachineTypesResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListVMMachineTypesResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/list_vms_response.py b/src/cudo_compute/models/list_vms_response.py new file mode 100644 index 0000000..24c4838 --- /dev/null +++ b/src/cudo_compute/models/list_vms_response.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ListVMsResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'vms': 'list[VM]' + } + + attribute_map = { + 'vms': 'VMs' + } + + def __init__(self, vms=None, _configuration=None): # noqa: E501 + """ListVMsResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._vms = None + self.discriminator = None + + if vms is not None: + self.vms = vms + + @property + def vms(self): + """Gets the vms of this ListVMsResponse. # noqa: E501 + + + :return: The vms of this ListVMsResponse. # noqa: E501 + :rtype: list[VM] + """ + return self._vms + + @vms.setter + def vms(self, vms): + """Sets the vms of this ListVMsResponse. + + + :param vms: The vms of this ListVMsResponse. # noqa: E501 + :type: list[VM] + """ + + self._vms = vms + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ListVMsResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ListVMsResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ListVMsResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/monitor_vm_response.py b/src/cudo_compute/models/monitor_vm_response.py new file mode 100644 index 0000000..892c97e --- /dev/null +++ b/src/cudo_compute/models/monitor_vm_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class MonitorVMResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'items': 'list[VMMonitoringItem]' + } + + attribute_map = { + 'items': 'items' + } + + def __init__(self, items=None, _configuration=None): # noqa: E501 + """MonitorVMResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._items = None + self.discriminator = None + + self.items = items + + @property + def items(self): + """Gets the items of this MonitorVMResponse. # noqa: E501 + + + :return: The items of this MonitorVMResponse. # noqa: E501 + :rtype: list[VMMonitoringItem] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this MonitorVMResponse. + + + :param items: The items of this MonitorVMResponse. # noqa: E501 + :type: list[VMMonitoringItem] + """ + if self._configuration.client_side_validation and items is None: + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorVMResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorVMResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, MonitorVMResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/network.py b/src/cudo_compute/models/network.py new file mode 100644 index 0000000..fd637c7 --- /dev/null +++ b/src/cudo_compute/models/network.py @@ -0,0 +1,435 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Network(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'active_state': 'str', + 'data_center_id': 'str', + 'external_ip_address': 'str', + 'gateway': 'str', + 'id': 'str', + 'init_state': 'str', + 'internal_ip_address': 'str', + 'ip_range': 'str', + 'one_lcm_state': 'str', + 'one_state': 'str', + 'price_hr': 'Decimal', + 'short_state': 'str', + 'size': 'VRouterSize' + } + + attribute_map = { + 'active_state': 'activeState', + 'data_center_id': 'dataCenterId', + 'external_ip_address': 'externalIpAddress', + 'gateway': 'gateway', + 'id': 'id', + 'init_state': 'initState', + 'internal_ip_address': 'internalIpAddress', + 'ip_range': 'ipRange', + 'one_lcm_state': 'oneLcmState', + 'one_state': 'oneState', + 'price_hr': 'priceHr', + 'short_state': 'shortState', + 'size': 'size' + } + + def __init__(self, active_state=None, data_center_id=None, external_ip_address=None, gateway=None, id=None, init_state=None, internal_ip_address=None, ip_range=None, one_lcm_state=None, one_state=None, price_hr=None, short_state=None, size=None, _configuration=None): # noqa: E501 + """Network - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._active_state = None + self._data_center_id = None + self._external_ip_address = None + self._gateway = None + self._id = None + self._init_state = None + self._internal_ip_address = None + self._ip_range = None + self._one_lcm_state = None + self._one_state = None + self._price_hr = None + self._short_state = None + self._size = None + self.discriminator = None + + if active_state is not None: + self.active_state = active_state + if data_center_id is not None: + self.data_center_id = data_center_id + if external_ip_address is not None: + self.external_ip_address = external_ip_address + if gateway is not None: + self.gateway = gateway + if id is not None: + self.id = id + if init_state is not None: + self.init_state = init_state + if internal_ip_address is not None: + self.internal_ip_address = internal_ip_address + if ip_range is not None: + self.ip_range = ip_range + if one_lcm_state is not None: + self.one_lcm_state = one_lcm_state + if one_state is not None: + self.one_state = one_state + if price_hr is not None: + self.price_hr = price_hr + if short_state is not None: + self.short_state = short_state + if size is not None: + self.size = size + + @property + def active_state(self): + """Gets the active_state of this Network. # noqa: E501 + + + :return: The active_state of this Network. # noqa: E501 + :rtype: str + """ + return self._active_state + + @active_state.setter + def active_state(self, active_state): + """Sets the active_state of this Network. + + + :param active_state: The active_state of this Network. # noqa: E501 + :type: str + """ + + self._active_state = active_state + + @property + def data_center_id(self): + """Gets the data_center_id of this Network. # noqa: E501 + + + :return: The data_center_id of this Network. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this Network. + + + :param data_center_id: The data_center_id of this Network. # noqa: E501 + :type: str + """ + + self._data_center_id = data_center_id + + @property + def external_ip_address(self): + """Gets the external_ip_address of this Network. # noqa: E501 + + + :return: The external_ip_address of this Network. # noqa: E501 + :rtype: str + """ + return self._external_ip_address + + @external_ip_address.setter + def external_ip_address(self, external_ip_address): + """Sets the external_ip_address of this Network. + + + :param external_ip_address: The external_ip_address of this Network. # noqa: E501 + :type: str + """ + + self._external_ip_address = external_ip_address + + @property + def gateway(self): + """Gets the gateway of this Network. # noqa: E501 + + + :return: The gateway of this Network. # noqa: E501 + :rtype: str + """ + return self._gateway + + @gateway.setter + def gateway(self, gateway): + """Sets the gateway of this Network. + + + :param gateway: The gateway of this Network. # noqa: E501 + :type: str + """ + + self._gateway = gateway + + @property + def id(self): + """Gets the id of this Network. # noqa: E501 + + + :return: The id of this Network. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Network. + + + :param id: The id of this Network. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def init_state(self): + """Gets the init_state of this Network. # noqa: E501 + + + :return: The init_state of this Network. # noqa: E501 + :rtype: str + """ + return self._init_state + + @init_state.setter + def init_state(self, init_state): + """Sets the init_state of this Network. + + + :param init_state: The init_state of this Network. # noqa: E501 + :type: str + """ + + self._init_state = init_state + + @property + def internal_ip_address(self): + """Gets the internal_ip_address of this Network. # noqa: E501 + + + :return: The internal_ip_address of this Network. # noqa: E501 + :rtype: str + """ + return self._internal_ip_address + + @internal_ip_address.setter + def internal_ip_address(self, internal_ip_address): + """Sets the internal_ip_address of this Network. + + + :param internal_ip_address: The internal_ip_address of this Network. # noqa: E501 + :type: str + """ + + self._internal_ip_address = internal_ip_address + + @property + def ip_range(self): + """Gets the ip_range of this Network. # noqa: E501 + + + :return: The ip_range of this Network. # noqa: E501 + :rtype: str + """ + return self._ip_range + + @ip_range.setter + def ip_range(self, ip_range): + """Sets the ip_range of this Network. + + + :param ip_range: The ip_range of this Network. # noqa: E501 + :type: str + """ + + self._ip_range = ip_range + + @property + def one_lcm_state(self): + """Gets the one_lcm_state of this Network. # noqa: E501 + + + :return: The one_lcm_state of this Network. # noqa: E501 + :rtype: str + """ + return self._one_lcm_state + + @one_lcm_state.setter + def one_lcm_state(self, one_lcm_state): + """Sets the one_lcm_state of this Network. + + + :param one_lcm_state: The one_lcm_state of this Network. # noqa: E501 + :type: str + """ + + self._one_lcm_state = one_lcm_state + + @property + def one_state(self): + """Gets the one_state of this Network. # noqa: E501 + + + :return: The one_state of this Network. # noqa: E501 + :rtype: str + """ + return self._one_state + + @one_state.setter + def one_state(self, one_state): + """Sets the one_state of this Network. + + + :param one_state: The one_state of this Network. # noqa: E501 + :type: str + """ + + self._one_state = one_state + + @property + def price_hr(self): + """Gets the price_hr of this Network. # noqa: E501 + + + :return: The price_hr of this Network. # noqa: E501 + :rtype: Decimal + """ + return self._price_hr + + @price_hr.setter + def price_hr(self, price_hr): + """Sets the price_hr of this Network. + + + :param price_hr: The price_hr of this Network. # noqa: E501 + :type: Decimal + """ + + self._price_hr = price_hr + + @property + def short_state(self): + """Gets the short_state of this Network. # noqa: E501 + + + :return: The short_state of this Network. # noqa: E501 + :rtype: str + """ + return self._short_state + + @short_state.setter + def short_state(self, short_state): + """Sets the short_state of this Network. + + + :param short_state: The short_state of this Network. # noqa: E501 + :type: str + """ + + self._short_state = short_state + + @property + def size(self): + """Gets the size of this Network. # noqa: E501 + + + :return: The size of this Network. # noqa: E501 + :rtype: VRouterSize + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this Network. + + + :param size: The size of this Network. # noqa: E501 + :type: VRouterSize + """ + + self._size = size + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Network, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Network): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Network): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/network_price_hr.py b/src/cudo_compute/models/network_price_hr.py new file mode 100644 index 0000000..bc9d62b --- /dev/null +++ b/src/cudo_compute/models/network_price_hr.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class NetworkPriceHr(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'price_hr': 'Decimal', + 'size': 'VRouterSize' + } + + attribute_map = { + 'price_hr': 'priceHr', + 'size': 'size' + } + + def __init__(self, price_hr=None, size=None, _configuration=None): # noqa: E501 + """NetworkPriceHr - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._price_hr = None + self._size = None + self.discriminator = None + + if price_hr is not None: + self.price_hr = price_hr + if size is not None: + self.size = size + + @property + def price_hr(self): + """Gets the price_hr of this NetworkPriceHr. # noqa: E501 + + + :return: The price_hr of this NetworkPriceHr. # noqa: E501 + :rtype: Decimal + """ + return self._price_hr + + @price_hr.setter + def price_hr(self, price_hr): + """Sets the price_hr of this NetworkPriceHr. + + + :param price_hr: The price_hr of this NetworkPriceHr. # noqa: E501 + :type: Decimal + """ + + self._price_hr = price_hr + + @property + def size(self): + """Gets the size of this NetworkPriceHr. # noqa: E501 + + + :return: The size of this NetworkPriceHr. # noqa: E501 + :rtype: VRouterSize + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this NetworkPriceHr. + + + :param size: The size of this NetworkPriceHr. # noqa: E501 + :type: VRouterSize + """ + + self._size = size + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(NetworkPriceHr, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NetworkPriceHr): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, NetworkPriceHr): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/object_storage_bucket.py b/src/cudo_compute/models/object_storage_bucket.py new file mode 100644 index 0000000..5fdcede --- /dev/null +++ b/src/cudo_compute/models/object_storage_bucket.py @@ -0,0 +1,279 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ObjectStorageBucket(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'billable_bytes': 'str', + 'data_center_id': 'str', + 'endpoint': 'str', + 'id': 'str', + 'object_count': 'str', + 'project_id': 'str', + 'size_bytes': 'str' + } + + attribute_map = { + 'billable_bytes': 'billableBytes', + 'data_center_id': 'dataCenterId', + 'endpoint': 'endpoint', + 'id': 'id', + 'object_count': 'objectCount', + 'project_id': 'projectId', + 'size_bytes': 'sizeBytes' + } + + def __init__(self, billable_bytes=None, data_center_id=None, endpoint=None, id=None, object_count=None, project_id=None, size_bytes=None, _configuration=None): # noqa: E501 + """ObjectStorageBucket - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._billable_bytes = None + self._data_center_id = None + self._endpoint = None + self._id = None + self._object_count = None + self._project_id = None + self._size_bytes = None + self.discriminator = None + + if billable_bytes is not None: + self.billable_bytes = billable_bytes + if data_center_id is not None: + self.data_center_id = data_center_id + if endpoint is not None: + self.endpoint = endpoint + if id is not None: + self.id = id + if object_count is not None: + self.object_count = object_count + if project_id is not None: + self.project_id = project_id + if size_bytes is not None: + self.size_bytes = size_bytes + + @property + def billable_bytes(self): + """Gets the billable_bytes of this ObjectStorageBucket. # noqa: E501 + + + :return: The billable_bytes of this ObjectStorageBucket. # noqa: E501 + :rtype: str + """ + return self._billable_bytes + + @billable_bytes.setter + def billable_bytes(self, billable_bytes): + """Sets the billable_bytes of this ObjectStorageBucket. + + + :param billable_bytes: The billable_bytes of this ObjectStorageBucket. # noqa: E501 + :type: str + """ + + self._billable_bytes = billable_bytes + + @property + def data_center_id(self): + """Gets the data_center_id of this ObjectStorageBucket. # noqa: E501 + + + :return: The data_center_id of this ObjectStorageBucket. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this ObjectStorageBucket. + + + :param data_center_id: The data_center_id of this ObjectStorageBucket. # noqa: E501 + :type: str + """ + + self._data_center_id = data_center_id + + @property + def endpoint(self): + """Gets the endpoint of this ObjectStorageBucket. # noqa: E501 + + + :return: The endpoint of this ObjectStorageBucket. # noqa: E501 + :rtype: str + """ + return self._endpoint + + @endpoint.setter + def endpoint(self, endpoint): + """Sets the endpoint of this ObjectStorageBucket. + + + :param endpoint: The endpoint of this ObjectStorageBucket. # noqa: E501 + :type: str + """ + + self._endpoint = endpoint + + @property + def id(self): + """Gets the id of this ObjectStorageBucket. # noqa: E501 + + + :return: The id of this ObjectStorageBucket. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ObjectStorageBucket. + + + :param id: The id of this ObjectStorageBucket. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def object_count(self): + """Gets the object_count of this ObjectStorageBucket. # noqa: E501 + + + :return: The object_count of this ObjectStorageBucket. # noqa: E501 + :rtype: str + """ + return self._object_count + + @object_count.setter + def object_count(self, object_count): + """Sets the object_count of this ObjectStorageBucket. + + + :param object_count: The object_count of this ObjectStorageBucket. # noqa: E501 + :type: str + """ + + self._object_count = object_count + + @property + def project_id(self): + """Gets the project_id of this ObjectStorageBucket. # noqa: E501 + + + :return: The project_id of this ObjectStorageBucket. # noqa: E501 + :rtype: str + """ + return self._project_id + + @project_id.setter + def project_id(self, project_id): + """Sets the project_id of this ObjectStorageBucket. + + + :param project_id: The project_id of this ObjectStorageBucket. # noqa: E501 + :type: str + """ + + self._project_id = project_id + + @property + def size_bytes(self): + """Gets the size_bytes of this ObjectStorageBucket. # noqa: E501 + + + :return: The size_bytes of this ObjectStorageBucket. # noqa: E501 + :rtype: str + """ + return self._size_bytes + + @size_bytes.setter + def size_bytes(self, size_bytes): + """Sets the size_bytes of this ObjectStorageBucket. + + + :param size_bytes: The size_bytes of this ObjectStorageBucket. # noqa: E501 + :type: str + """ + + self._size_bytes = size_bytes + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ObjectStorageBucket, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ObjectStorageBucket): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ObjectStorageBucket): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/object_storage_key.py b/src/cudo_compute/models/object_storage_key.py new file mode 100644 index 0000000..96aadfb --- /dev/null +++ b/src/cudo_compute/models/object_storage_key.py @@ -0,0 +1,227 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ObjectStorageKey(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'access_key': 'str', + 'create_by': 'str', + 'create_time': 'datetime', + 'id': 'str', + 'secret_key': 'str' + } + + attribute_map = { + 'access_key': 'accessKey', + 'create_by': 'createBy', + 'create_time': 'createTime', + 'id': 'id', + 'secret_key': 'secretKey' + } + + def __init__(self, access_key=None, create_by=None, create_time=None, id=None, secret_key=None, _configuration=None): # noqa: E501 + """ObjectStorageKey - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._access_key = None + self._create_by = None + self._create_time = None + self._id = None + self._secret_key = None + self.discriminator = None + + if access_key is not None: + self.access_key = access_key + if create_by is not None: + self.create_by = create_by + if create_time is not None: + self.create_time = create_time + if id is not None: + self.id = id + if secret_key is not None: + self.secret_key = secret_key + + @property + def access_key(self): + """Gets the access_key of this ObjectStorageKey. # noqa: E501 + + + :return: The access_key of this ObjectStorageKey. # noqa: E501 + :rtype: str + """ + return self._access_key + + @access_key.setter + def access_key(self, access_key): + """Sets the access_key of this ObjectStorageKey. + + + :param access_key: The access_key of this ObjectStorageKey. # noqa: E501 + :type: str + """ + + self._access_key = access_key + + @property + def create_by(self): + """Gets the create_by of this ObjectStorageKey. # noqa: E501 + + + :return: The create_by of this ObjectStorageKey. # noqa: E501 + :rtype: str + """ + return self._create_by + + @create_by.setter + def create_by(self, create_by): + """Sets the create_by of this ObjectStorageKey. + + + :param create_by: The create_by of this ObjectStorageKey. # noqa: E501 + :type: str + """ + + self._create_by = create_by + + @property + def create_time(self): + """Gets the create_time of this ObjectStorageKey. # noqa: E501 + + + :return: The create_time of this ObjectStorageKey. # noqa: E501 + :rtype: datetime + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this ObjectStorageKey. + + + :param create_time: The create_time of this ObjectStorageKey. # noqa: E501 + :type: datetime + """ + + self._create_time = create_time + + @property + def id(self): + """Gets the id of this ObjectStorageKey. # noqa: E501 + + + :return: The id of this ObjectStorageKey. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ObjectStorageKey. + + + :param id: The id of this ObjectStorageKey. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def secret_key(self): + """Gets the secret_key of this ObjectStorageKey. # noqa: E501 + + + :return: The secret_key of this ObjectStorageKey. # noqa: E501 + :rtype: str + """ + return self._secret_key + + @secret_key.setter + def secret_key(self, secret_key): + """Sets the secret_key of this ObjectStorageKey. + + + :param secret_key: The secret_key of this ObjectStorageKey. # noqa: E501 + :type: str + """ + + self._secret_key = secret_key + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ObjectStorageKey, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ObjectStorageKey): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ObjectStorageKey): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/object_storage_user.py b/src/cudo_compute/models/object_storage_user.py new file mode 100644 index 0000000..9137643 --- /dev/null +++ b/src/cudo_compute/models/object_storage_user.py @@ -0,0 +1,201 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ObjectStorageUser(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'create_by': 'str', + 'create_time': 'datetime', + 'id': 'str', + 'key_count': 'int' + } + + attribute_map = { + 'create_by': 'createBy', + 'create_time': 'createTime', + 'id': 'id', + 'key_count': 'keyCount' + } + + def __init__(self, create_by=None, create_time=None, id=None, key_count=None, _configuration=None): # noqa: E501 + """ObjectStorageUser - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._create_by = None + self._create_time = None + self._id = None + self._key_count = None + self.discriminator = None + + if create_by is not None: + self.create_by = create_by + if create_time is not None: + self.create_time = create_time + if id is not None: + self.id = id + if key_count is not None: + self.key_count = key_count + + @property + def create_by(self): + """Gets the create_by of this ObjectStorageUser. # noqa: E501 + + + :return: The create_by of this ObjectStorageUser. # noqa: E501 + :rtype: str + """ + return self._create_by + + @create_by.setter + def create_by(self, create_by): + """Sets the create_by of this ObjectStorageUser. + + + :param create_by: The create_by of this ObjectStorageUser. # noqa: E501 + :type: str + """ + + self._create_by = create_by + + @property + def create_time(self): + """Gets the create_time of this ObjectStorageUser. # noqa: E501 + + + :return: The create_time of this ObjectStorageUser. # noqa: E501 + :rtype: datetime + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this ObjectStorageUser. + + + :param create_time: The create_time of this ObjectStorageUser. # noqa: E501 + :type: datetime + """ + + self._create_time = create_time + + @property + def id(self): + """Gets the id of this ObjectStorageUser. # noqa: E501 + + + :return: The id of this ObjectStorageUser. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ObjectStorageUser. + + + :param id: The id of this ObjectStorageUser. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def key_count(self): + """Gets the key_count of this ObjectStorageUser. # noqa: E501 + + + :return: The key_count of this ObjectStorageUser. # noqa: E501 + :rtype: int + """ + return self._key_count + + @key_count.setter + def key_count(self, key_count): + """Sets the key_count of this ObjectStorageUser. + + + :param key_count: The key_count of this ObjectStorageUser. # noqa: E501 + :type: int + """ + + self._key_count = key_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ObjectStorageUser, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ObjectStorageUser): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ObjectStorageUser): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/profile.py b/src/cudo_compute/models/profile.py new file mode 100644 index 0000000..a6b2614 --- /dev/null +++ b/src/cudo_compute/models/profile.py @@ -0,0 +1,201 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Profile(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'email_address': 'str', + 'first_name': 'str', + 'last_name': 'str', + 'picture': 'str' + } + + attribute_map = { + 'email_address': 'emailAddress', + 'first_name': 'firstName', + 'last_name': 'lastName', + 'picture': 'picture' + } + + def __init__(self, email_address=None, first_name=None, last_name=None, picture=None, _configuration=None): # noqa: E501 + """Profile - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._email_address = None + self._first_name = None + self._last_name = None + self._picture = None + self.discriminator = None + + if email_address is not None: + self.email_address = email_address + if first_name is not None: + self.first_name = first_name + if last_name is not None: + self.last_name = last_name + if picture is not None: + self.picture = picture + + @property + def email_address(self): + """Gets the email_address of this Profile. # noqa: E501 + + + :return: The email_address of this Profile. # noqa: E501 + :rtype: str + """ + return self._email_address + + @email_address.setter + def email_address(self, email_address): + """Sets the email_address of this Profile. + + + :param email_address: The email_address of this Profile. # noqa: E501 + :type: str + """ + + self._email_address = email_address + + @property + def first_name(self): + """Gets the first_name of this Profile. # noqa: E501 + + + :return: The first_name of this Profile. # noqa: E501 + :rtype: str + """ + return self._first_name + + @first_name.setter + def first_name(self, first_name): + """Sets the first_name of this Profile. + + + :param first_name: The first_name of this Profile. # noqa: E501 + :type: str + """ + + self._first_name = first_name + + @property + def last_name(self): + """Gets the last_name of this Profile. # noqa: E501 + + + :return: The last_name of this Profile. # noqa: E501 + :rtype: str + """ + return self._last_name + + @last_name.setter + def last_name(self, last_name): + """Sets the last_name of this Profile. + + + :param last_name: The last_name of this Profile. # noqa: E501 + :type: str + """ + + self._last_name = last_name + + @property + def picture(self): + """Gets the picture of this Profile. # noqa: E501 + + + :return: The picture of this Profile. # noqa: E501 + :rtype: str + """ + return self._picture + + @picture.setter + def picture(self, picture): + """Sets the picture of this Profile. + + + :param picture: The picture of this Profile. # noqa: E501 + :type: str + """ + + self._picture = picture + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Profile, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Profile): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Profile): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/project.py b/src/cudo_compute/models/project.py new file mode 100644 index 0000000..70bbc46 --- /dev/null +++ b/src/cudo_compute/models/project.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Project(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'billing_account_id': 'str', + 'create_by': 'str', + 'resource_count': 'int' + } + + attribute_map = { + 'billing_account_id': 'billingAccountId', + 'create_by': 'createBy', + 'resource_count': 'resourceCount' + } + + def __init__(self, billing_account_id=None, create_by=None, resource_count=None, _configuration=None): # noqa: E501 + """Project - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._billing_account_id = None + self._create_by = None + self._resource_count = None + self.discriminator = None + + self.billing_account_id = billing_account_id + if create_by is not None: + self.create_by = create_by + if resource_count is not None: + self.resource_count = resource_count + + @property + def billing_account_id(self): + """Gets the billing_account_id of this Project. # noqa: E501 + + + :return: The billing_account_id of this Project. # noqa: E501 + :rtype: str + """ + return self._billing_account_id + + @billing_account_id.setter + def billing_account_id(self, billing_account_id): + """Sets the billing_account_id of this Project. + + + :param billing_account_id: The billing_account_id of this Project. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and billing_account_id is None: + raise ValueError("Invalid value for `billing_account_id`, must not be `None`") # noqa: E501 + + self._billing_account_id = billing_account_id + + @property + def create_by(self): + """Gets the create_by of this Project. # noqa: E501 + + + :return: The create_by of this Project. # noqa: E501 + :rtype: str + """ + return self._create_by + + @create_by.setter + def create_by(self, create_by): + """Sets the create_by of this Project. + + + :param create_by: The create_by of this Project. # noqa: E501 + :type: str + """ + + self._create_by = create_by + + @property + def resource_count(self): + """Gets the resource_count of this Project. # noqa: E501 + + + :return: The resource_count of this Project. # noqa: E501 + :rtype: int + """ + return self._resource_count + + @resource_count.setter + def resource_count(self, resource_count): + """Sets the resource_count of this Project. + + + :param resource_count: The resource_count of this Project. # noqa: E501 + :type: int + """ + + self._resource_count = resource_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Project, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Project): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Project): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/protocol.py b/src/cudo_compute/models/protocol.py new file mode 100644 index 0000000..471348a --- /dev/null +++ b/src/cudo_compute/models/protocol.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Protocol(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + UNKNOWN = "PROTOCOL_UNKNOWN" + ALL = "PROTOCOL_ALL" + TCP = "PROTOCOL_TCP" + UDP = "PROTOCOL_UDP" + ICMP = "PROTOCOL_ICMP" + ICMPV6 = "PROTOCOL_ICMPv6" + IPSEC = "PROTOCOL_IPSEC" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """Protocol - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Protocol, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Protocol): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Protocol): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/reboot_vm_response.py b/src/cudo_compute/models/reboot_vm_response.py new file mode 100644 index 0000000..0cd55f7 --- /dev/null +++ b/src/cudo_compute/models/reboot_vm_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class RebootVMResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """RebootVMResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(RebootVMResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RebootVMResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, RebootVMResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/region.py b/src/cudo_compute/models/region.py new file mode 100644 index 0000000..f592bbc --- /dev/null +++ b/src/cudo_compute/models/region.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Region(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None, _configuration=None): # noqa: E501 + """Region - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._id = None + self._name = None + self.discriminator = None + + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this Region. # noqa: E501 + + + :return: The id of this Region. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Region. + + + :param id: The id of this Region. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this Region. # noqa: E501 + + + :return: The name of this Region. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Region. + + + :param name: The name of this Region. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Region, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Region): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Region): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/resize_vm_disk_response.py b/src/cudo_compute/models/resize_vm_disk_response.py new file mode 100644 index 0000000..86b71e1 --- /dev/null +++ b/src/cudo_compute/models/resize_vm_disk_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ResizeVMDiskResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """ResizeVMDiskResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ResizeVMDiskResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ResizeVMDiskResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ResizeVMDiskResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/resize_vm_response.py b/src/cudo_compute/models/resize_vm_response.py new file mode 100644 index 0000000..de1fee4 --- /dev/null +++ b/src/cudo_compute/models/resize_vm_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class ResizeVMResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'vm': 'VM' + } + + attribute_map = { + 'vm': 'vm' + } + + def __init__(self, vm=None, _configuration=None): # noqa: E501 + """ResizeVMResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._vm = None + self.discriminator = None + + self.vm = vm + + @property + def vm(self): + """Gets the vm of this ResizeVMResponse. # noqa: E501 + + + :return: The vm of this ResizeVMResponse. # noqa: E501 + :rtype: VM + """ + return self._vm + + @vm.setter + def vm(self, vm): + """Sets the vm of this ResizeVMResponse. + + + :param vm: The vm of this ResizeVMResponse. # noqa: E501 + :type: VM + """ + if self._configuration.client_side_validation and vm is None: + raise ValueError("Invalid value for `vm`, must not be `None`") # noqa: E501 + + self._vm = vm + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ResizeVMResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ResizeVMResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ResizeVMResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/revert_disk_response.py b/src/cudo_compute/models/revert_disk_response.py new file mode 100644 index 0000000..2c17ff9 --- /dev/null +++ b/src/cudo_compute/models/revert_disk_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class RevertDiskResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """RevertDiskResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(RevertDiskResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RevertDiskResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, RevertDiskResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/role.py b/src/cudo_compute/models/role.py new file mode 100644 index 0000000..40bcc55 --- /dev/null +++ b/src/cudo_compute/models/role.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Role(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + UNKNOWN = "UNKNOWN" + OWNER = "OWNER" + VIEWER = "VIEWER" + EDITOR = "EDITOR" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """Role - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Role, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Role): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Role): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/rule.py b/src/cudo_compute/models/rule.py new file mode 100644 index 0000000..553c4ce --- /dev/null +++ b/src/cudo_compute/models/rule.py @@ -0,0 +1,253 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Rule(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'icmp_type': 'str', + 'id': 'str', + 'ip_range_cidr': 'str', + 'ports': 'str', + 'protocol': 'Protocol', + 'rule_type': 'RuleType' + } + + attribute_map = { + 'icmp_type': 'icmpType', + 'id': 'id', + 'ip_range_cidr': 'ipRangeCidr', + 'ports': 'ports', + 'protocol': 'protocol', + 'rule_type': 'ruleType' + } + + def __init__(self, icmp_type=None, id=None, ip_range_cidr=None, ports=None, protocol=None, rule_type=None, _configuration=None): # noqa: E501 + """Rule - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._icmp_type = None + self._id = None + self._ip_range_cidr = None + self._ports = None + self._protocol = None + self._rule_type = None + self.discriminator = None + + if icmp_type is not None: + self.icmp_type = icmp_type + if id is not None: + self.id = id + if ip_range_cidr is not None: + self.ip_range_cidr = ip_range_cidr + if ports is not None: + self.ports = ports + if protocol is not None: + self.protocol = protocol + if rule_type is not None: + self.rule_type = rule_type + + @property + def icmp_type(self): + """Gets the icmp_type of this Rule. # noqa: E501 + + + :return: The icmp_type of this Rule. # noqa: E501 + :rtype: str + """ + return self._icmp_type + + @icmp_type.setter + def icmp_type(self, icmp_type): + """Sets the icmp_type of this Rule. + + + :param icmp_type: The icmp_type of this Rule. # noqa: E501 + :type: str + """ + + self._icmp_type = icmp_type + + @property + def id(self): + """Gets the id of this Rule. # noqa: E501 + + + :return: The id of this Rule. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Rule. + + + :param id: The id of this Rule. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def ip_range_cidr(self): + """Gets the ip_range_cidr of this Rule. # noqa: E501 + + + :return: The ip_range_cidr of this Rule. # noqa: E501 + :rtype: str + """ + return self._ip_range_cidr + + @ip_range_cidr.setter + def ip_range_cidr(self, ip_range_cidr): + """Sets the ip_range_cidr of this Rule. + + + :param ip_range_cidr: The ip_range_cidr of this Rule. # noqa: E501 + :type: str + """ + + self._ip_range_cidr = ip_range_cidr + + @property + def ports(self): + """Gets the ports of this Rule. # noqa: E501 + + + :return: The ports of this Rule. # noqa: E501 + :rtype: str + """ + return self._ports + + @ports.setter + def ports(self, ports): + """Sets the ports of this Rule. + + + :param ports: The ports of this Rule. # noqa: E501 + :type: str + """ + + self._ports = ports + + @property + def protocol(self): + """Gets the protocol of this Rule. # noqa: E501 + + + :return: The protocol of this Rule. # noqa: E501 + :rtype: Protocol + """ + return self._protocol + + @protocol.setter + def protocol(self, protocol): + """Sets the protocol of this Rule. + + + :param protocol: The protocol of this Rule. # noqa: E501 + :type: Protocol + """ + + self._protocol = protocol + + @property + def rule_type(self): + """Gets the rule_type of this Rule. # noqa: E501 + + + :return: The rule_type of this Rule. # noqa: E501 + :rtype: RuleType + """ + return self._rule_type + + @rule_type.setter + def rule_type(self, rule_type): + """Sets the rule_type of this Rule. + + + :param rule_type: The rule_type of this Rule. # noqa: E501 + :type: RuleType + """ + + self._rule_type = rule_type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Rule, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Rule): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Rule): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/rule_type.py b/src/cudo_compute/models/rule_type.py new file mode 100644 index 0000000..7c8c4e9 --- /dev/null +++ b/src/cudo_compute/models/rule_type.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class RuleType(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + UNKNOWN = "RULE_TYPE_UNKNOWN" + INBOUND = "RULE_TYPE_INBOUND" + OUTBOUND = "RULE_TYPE_OUTBOUND" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """RuleType - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(RuleType, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RuleType): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, RuleType): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/security_group.py b/src/cudo_compute/models/security_group.py new file mode 100644 index 0000000..79f2a1f --- /dev/null +++ b/src/cudo_compute/models/security_group.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class SecurityGroup(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data_center_id': 'str', + 'description': 'str', + 'id': 'str', + 'rules': 'list[Rule]' + } + + attribute_map = { + 'data_center_id': 'dataCenterId', + 'description': 'description', + 'id': 'id', + 'rules': 'rules' + } + + def __init__(self, data_center_id=None, description=None, id=None, rules=None, _configuration=None): # noqa: E501 + """SecurityGroup - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._data_center_id = None + self._description = None + self._id = None + self._rules = None + self.discriminator = None + + self.data_center_id = data_center_id + if description is not None: + self.description = description + self.id = id + if rules is not None: + self.rules = rules + + @property + def data_center_id(self): + """Gets the data_center_id of this SecurityGroup. # noqa: E501 + + + :return: The data_center_id of this SecurityGroup. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this SecurityGroup. + + + :param data_center_id: The data_center_id of this SecurityGroup. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and data_center_id is None: + raise ValueError("Invalid value for `data_center_id`, must not be `None`") # noqa: E501 + + self._data_center_id = data_center_id + + @property + def description(self): + """Gets the description of this SecurityGroup. # noqa: E501 + + + :return: The description of this SecurityGroup. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this SecurityGroup. + + + :param description: The description of this SecurityGroup. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def id(self): + """Gets the id of this SecurityGroup. # noqa: E501 + + + :return: The id of this SecurityGroup. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SecurityGroup. + + + :param id: The id of this SecurityGroup. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def rules(self): + """Gets the rules of this SecurityGroup. # noqa: E501 + + + :return: The rules of this SecurityGroup. # noqa: E501 + :rtype: list[Rule] + """ + return self._rules + + @rules.setter + def rules(self, rules): + """Sets the rules of this SecurityGroup. + + + :param rules: The rules of this SecurityGroup. # noqa: E501 + :type: list[Rule] + """ + + self._rules = rules + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SecurityGroup, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SecurityGroup): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SecurityGroup): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/security_group1.py b/src/cudo_compute/models/security_group1.py new file mode 100644 index 0000000..5094786 --- /dev/null +++ b/src/cudo_compute/models/security_group1.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class SecurityGroup1(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data_center_id': 'str', + 'description': 'str', + 'rules': 'list[Rule]' + } + + attribute_map = { + 'data_center_id': 'dataCenterId', + 'description': 'description', + 'rules': 'rules' + } + + def __init__(self, data_center_id=None, description=None, rules=None, _configuration=None): # noqa: E501 + """SecurityGroup1 - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._data_center_id = None + self._description = None + self._rules = None + self.discriminator = None + + self.data_center_id = data_center_id + if description is not None: + self.description = description + if rules is not None: + self.rules = rules + + @property + def data_center_id(self): + """Gets the data_center_id of this SecurityGroup1. # noqa: E501 + + + :return: The data_center_id of this SecurityGroup1. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this SecurityGroup1. + + + :param data_center_id: The data_center_id of this SecurityGroup1. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and data_center_id is None: + raise ValueError("Invalid value for `data_center_id`, must not be `None`") # noqa: E501 + + self._data_center_id = data_center_id + + @property + def description(self): + """Gets the description of this SecurityGroup1. # noqa: E501 + + + :return: The description of this SecurityGroup1. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this SecurityGroup1. + + + :param description: The description of this SecurityGroup1. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def rules(self): + """Gets the rules of this SecurityGroup1. # noqa: E501 + + + :return: The rules of this SecurityGroup1. # noqa: E501 + :rtype: list[Rule] + """ + return self._rules + + @rules.setter + def rules(self, rules): + """Sets the rules of this SecurityGroup1. + + + :param rules: The rules of this SecurityGroup1. # noqa: E501 + :type: list[Rule] + """ + + self._rules = rules + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SecurityGroup1, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SecurityGroup1): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SecurityGroup1): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/security_group_rule.py b/src/cudo_compute/models/security_group_rule.py new file mode 100644 index 0000000..5a78c32 --- /dev/null +++ b/src/cudo_compute/models/security_group_rule.py @@ -0,0 +1,253 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class SecurityGroupRule(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'icmp_type': 'str', + 'id': 'str', + 'ip_range_cidr': 'str', + 'ports': 'str', + 'protocol': 'Protocol', + 'rule_type': 'RuleType' + } + + attribute_map = { + 'icmp_type': 'icmpType', + 'id': 'id', + 'ip_range_cidr': 'ipRangeCidr', + 'ports': 'ports', + 'protocol': 'protocol', + 'rule_type': 'ruleType' + } + + def __init__(self, icmp_type=None, id=None, ip_range_cidr=None, ports=None, protocol=None, rule_type=None, _configuration=None): # noqa: E501 + """SecurityGroupRule - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._icmp_type = None + self._id = None + self._ip_range_cidr = None + self._ports = None + self._protocol = None + self._rule_type = None + self.discriminator = None + + if icmp_type is not None: + self.icmp_type = icmp_type + if id is not None: + self.id = id + if ip_range_cidr is not None: + self.ip_range_cidr = ip_range_cidr + if ports is not None: + self.ports = ports + if protocol is not None: + self.protocol = protocol + if rule_type is not None: + self.rule_type = rule_type + + @property + def icmp_type(self): + """Gets the icmp_type of this SecurityGroupRule. # noqa: E501 + + + :return: The icmp_type of this SecurityGroupRule. # noqa: E501 + :rtype: str + """ + return self._icmp_type + + @icmp_type.setter + def icmp_type(self, icmp_type): + """Sets the icmp_type of this SecurityGroupRule. + + + :param icmp_type: The icmp_type of this SecurityGroupRule. # noqa: E501 + :type: str + """ + + self._icmp_type = icmp_type + + @property + def id(self): + """Gets the id of this SecurityGroupRule. # noqa: E501 + + + :return: The id of this SecurityGroupRule. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SecurityGroupRule. + + + :param id: The id of this SecurityGroupRule. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def ip_range_cidr(self): + """Gets the ip_range_cidr of this SecurityGroupRule. # noqa: E501 + + + :return: The ip_range_cidr of this SecurityGroupRule. # noqa: E501 + :rtype: str + """ + return self._ip_range_cidr + + @ip_range_cidr.setter + def ip_range_cidr(self, ip_range_cidr): + """Sets the ip_range_cidr of this SecurityGroupRule. + + + :param ip_range_cidr: The ip_range_cidr of this SecurityGroupRule. # noqa: E501 + :type: str + """ + + self._ip_range_cidr = ip_range_cidr + + @property + def ports(self): + """Gets the ports of this SecurityGroupRule. # noqa: E501 + + + :return: The ports of this SecurityGroupRule. # noqa: E501 + :rtype: str + """ + return self._ports + + @ports.setter + def ports(self, ports): + """Sets the ports of this SecurityGroupRule. + + + :param ports: The ports of this SecurityGroupRule. # noqa: E501 + :type: str + """ + + self._ports = ports + + @property + def protocol(self): + """Gets the protocol of this SecurityGroupRule. # noqa: E501 + + + :return: The protocol of this SecurityGroupRule. # noqa: E501 + :rtype: Protocol + """ + return self._protocol + + @protocol.setter + def protocol(self, protocol): + """Sets the protocol of this SecurityGroupRule. + + + :param protocol: The protocol of this SecurityGroupRule. # noqa: E501 + :type: Protocol + """ + + self._protocol = protocol + + @property + def rule_type(self): + """Gets the rule_type of this SecurityGroupRule. # noqa: E501 + + + :return: The rule_type of this SecurityGroupRule. # noqa: E501 + :rtype: RuleType + """ + return self._rule_type + + @rule_type.setter + def rule_type(self, rule_type): + """Sets the rule_type of this SecurityGroupRule. + + + :param rule_type: The rule_type of this SecurityGroupRule. # noqa: E501 + :type: RuleType + """ + + self._rule_type = rule_type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SecurityGroupRule, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SecurityGroupRule): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SecurityGroupRule): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/snapshot.py b/src/cudo_compute/models/snapshot.py new file mode 100644 index 0000000..323809f --- /dev/null +++ b/src/cudo_compute/models/snapshot.py @@ -0,0 +1,201 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Snapshot(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'active': 'bool', + 'create_time': 'datetime', + 'id': 'str', + 'size_gib': 'int' + } + + attribute_map = { + 'active': 'active', + 'create_time': 'createTime', + 'id': 'id', + 'size_gib': 'sizeGib' + } + + def __init__(self, active=None, create_time=None, id=None, size_gib=None, _configuration=None): # noqa: E501 + """Snapshot - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._active = None + self._create_time = None + self._id = None + self._size_gib = None + self.discriminator = None + + if active is not None: + self.active = active + if create_time is not None: + self.create_time = create_time + if id is not None: + self.id = id + if size_gib is not None: + self.size_gib = size_gib + + @property + def active(self): + """Gets the active of this Snapshot. # noqa: E501 + + + :return: The active of this Snapshot. # noqa: E501 + :rtype: bool + """ + return self._active + + @active.setter + def active(self, active): + """Sets the active of this Snapshot. + + + :param active: The active of this Snapshot. # noqa: E501 + :type: bool + """ + + self._active = active + + @property + def create_time(self): + """Gets the create_time of this Snapshot. # noqa: E501 + + + :return: The create_time of this Snapshot. # noqa: E501 + :rtype: datetime + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this Snapshot. + + + :param create_time: The create_time of this Snapshot. # noqa: E501 + :type: datetime + """ + + self._create_time = create_time + + @property + def id(self): + """Gets the id of this Snapshot. # noqa: E501 + + + :return: The id of this Snapshot. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Snapshot. + + + :param id: The id of this Snapshot. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def size_gib(self): + """Gets the size_gib of this Snapshot. # noqa: E501 + + + :return: The size_gib of this Snapshot. # noqa: E501 + :rtype: int + """ + return self._size_gib + + @size_gib.setter + def size_gib(self, size_gib): + """Sets the size_gib of this Snapshot. + + + :param size_gib: The size_gib of this Snapshot. # noqa: E501 + :type: int + """ + + self._size_gib = size_gib + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Snapshot, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Snapshot): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Snapshot): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/ssh_key.py b/src/cudo_compute/models/ssh_key.py new file mode 100644 index 0000000..a18ccaf --- /dev/null +++ b/src/cudo_compute/models/ssh_key.py @@ -0,0 +1,254 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class SshKey(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'comment': 'str', + 'create_time': 'datetime', + 'fingerprint': 'str', + 'id': 'str', + 'public_key': 'str', + 'type': 'str' + } + + attribute_map = { + 'comment': 'comment', + 'create_time': 'createTime', + 'fingerprint': 'fingerprint', + 'id': 'id', + 'public_key': 'publicKey', + 'type': 'type' + } + + def __init__(self, comment=None, create_time=None, fingerprint=None, id=None, public_key=None, type=None, _configuration=None): # noqa: E501 + """SshKey - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._comment = None + self._create_time = None + self._fingerprint = None + self._id = None + self._public_key = None + self._type = None + self.discriminator = None + + if comment is not None: + self.comment = comment + if create_time is not None: + self.create_time = create_time + if fingerprint is not None: + self.fingerprint = fingerprint + if id is not None: + self.id = id + self.public_key = public_key + if type is not None: + self.type = type + + @property + def comment(self): + """Gets the comment of this SshKey. # noqa: E501 + + + :return: The comment of this SshKey. # noqa: E501 + :rtype: str + """ + return self._comment + + @comment.setter + def comment(self, comment): + """Sets the comment of this SshKey. + + + :param comment: The comment of this SshKey. # noqa: E501 + :type: str + """ + + self._comment = comment + + @property + def create_time(self): + """Gets the create_time of this SshKey. # noqa: E501 + + + :return: The create_time of this SshKey. # noqa: E501 + :rtype: datetime + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this SshKey. + + + :param create_time: The create_time of this SshKey. # noqa: E501 + :type: datetime + """ + + self._create_time = create_time + + @property + def fingerprint(self): + """Gets the fingerprint of this SshKey. # noqa: E501 + + + :return: The fingerprint of this SshKey. # noqa: E501 + :rtype: str + """ + return self._fingerprint + + @fingerprint.setter + def fingerprint(self, fingerprint): + """Sets the fingerprint of this SshKey. + + + :param fingerprint: The fingerprint of this SshKey. # noqa: E501 + :type: str + """ + + self._fingerprint = fingerprint + + @property + def id(self): + """Gets the id of this SshKey. # noqa: E501 + + + :return: The id of this SshKey. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SshKey. + + + :param id: The id of this SshKey. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def public_key(self): + """Gets the public_key of this SshKey. # noqa: E501 + + + :return: The public_key of this SshKey. # noqa: E501 + :rtype: str + """ + return self._public_key + + @public_key.setter + def public_key(self, public_key): + """Sets the public_key of this SshKey. + + + :param public_key: The public_key of this SshKey. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and public_key is None: + raise ValueError("Invalid value for `public_key`, must not be `None`") # noqa: E501 + + self._public_key = public_key + + @property + def type(self): + """Gets the type of this SshKey. # noqa: E501 + + + :return: The type of this SshKey. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SshKey. + + + :param type: The type of this SshKey. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SshKey, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SshKey): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SshKey): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/ssh_key_source.py b/src/cudo_compute/models/ssh_key_source.py new file mode 100644 index 0000000..946fdc0 --- /dev/null +++ b/src/cudo_compute/models/ssh_key_source.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class SshKeySource(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + UNKNOWN = "SSH_KEY_SOURCE_UNKNOWN" + PROJECT = "SSH_KEY_SOURCE_PROJECT" + USER = "SSH_KEY_SOURCE_USER" + NONE = "SSH_KEY_SOURCE_NONE" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """SshKeySource - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SshKeySource, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SshKeySource): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SshKeySource): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/start_network_response.py b/src/cudo_compute/models/start_network_response.py new file mode 100644 index 0000000..2e5f907 --- /dev/null +++ b/src/cudo_compute/models/start_network_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class StartNetworkResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """StartNetworkResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StartNetworkResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StartNetworkResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StartNetworkResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/start_vm_response.py b/src/cudo_compute/models/start_vm_response.py new file mode 100644 index 0000000..f1e1c32 --- /dev/null +++ b/src/cudo_compute/models/start_vm_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class StartVMResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """StartVMResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StartVMResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StartVMResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StartVMResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/status.py b/src/cudo_compute/models/status.py new file mode 100644 index 0000000..854057d --- /dev/null +++ b/src/cudo_compute/models/status.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class Status(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'code': 'int', + 'details': 'list[Any]', + 'message': 'str' + } + + attribute_map = { + 'code': 'code', + 'details': 'details', + 'message': 'message' + } + + def __init__(self, code=None, details=None, message=None, _configuration=None): # noqa: E501 + """Status - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._code = None + self._details = None + self._message = None + self.discriminator = None + + if code is not None: + self.code = code + if details is not None: + self.details = details + if message is not None: + self.message = message + + @property + def code(self): + """Gets the code of this Status. # noqa: E501 + + + :return: The code of this Status. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this Status. + + + :param code: The code of this Status. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def details(self): + """Gets the details of this Status. # noqa: E501 + + + :return: The details of this Status. # noqa: E501 + :rtype: list[Any] + """ + return self._details + + @details.setter + def details(self, details): + """Sets the details of this Status. + + + :param details: The details of this Status. # noqa: E501 + :type: list[Any] + """ + + self._details = details + + @property + def message(self): + """Gets the message of this Status. # noqa: E501 + + + :return: The message of this Status. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this Status. + + + :param message: The message of this Status. # noqa: E501 + :type: str + """ + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Status, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Status): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Status): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/stop_network_response.py b/src/cudo_compute/models/stop_network_response.py new file mode 100644 index 0000000..2eeee93 --- /dev/null +++ b/src/cudo_compute/models/stop_network_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class StopNetworkResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """StopNetworkResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StopNetworkResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StopNetworkResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StopNetworkResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/stop_vm_response.py b/src/cudo_compute/models/stop_vm_response.py new file mode 100644 index 0000000..1ff1e10 --- /dev/null +++ b/src/cudo_compute/models/stop_vm_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class StopVMResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """StopVMResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StopVMResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StopVMResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StopVMResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/terminate_vm_response.py b/src/cudo_compute/models/terminate_vm_response.py new file mode 100644 index 0000000..8516819 --- /dev/null +++ b/src/cudo_compute/models/terminate_vm_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class TerminateVMResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """TerminateVMResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TerminateVMResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TerminateVMResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, TerminateVMResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/update_private_vm_image_response.py b/src/cudo_compute/models/update_private_vm_image_response.py new file mode 100644 index 0000000..e351ff4 --- /dev/null +++ b/src/cudo_compute/models/update_private_vm_image_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class UpdatePrivateVMImageResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """UpdatePrivateVMImageResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UpdatePrivateVMImageResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UpdatePrivateVMImageResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UpdatePrivateVMImageResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/update_security_group_response.py b/src/cudo_compute/models/update_security_group_response.py new file mode 100644 index 0000000..e3925c8 --- /dev/null +++ b/src/cudo_compute/models/update_security_group_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class UpdateSecurityGroupResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'security_group': 'SecurityGroup' + } + + attribute_map = { + 'security_group': 'securityGroup' + } + + def __init__(self, security_group=None, _configuration=None): # noqa: E501 + """UpdateSecurityGroupResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._security_group = None + self.discriminator = None + + self.security_group = security_group + + @property + def security_group(self): + """Gets the security_group of this UpdateSecurityGroupResponse. # noqa: E501 + + + :return: The security_group of this UpdateSecurityGroupResponse. # noqa: E501 + :rtype: SecurityGroup + """ + return self._security_group + + @security_group.setter + def security_group(self, security_group): + """Sets the security_group of this UpdateSecurityGroupResponse. + + + :param security_group: The security_group of this UpdateSecurityGroupResponse. # noqa: E501 + :type: SecurityGroup + """ + if self._configuration.client_side_validation and security_group is None: + raise ValueError("Invalid value for `security_group`, must not be `None`") # noqa: E501 + + self._security_group = security_group + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UpdateSecurityGroupResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UpdateSecurityGroupResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UpdateSecurityGroupResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/user_permission.py b/src/cudo_compute/models/user_permission.py new file mode 100644 index 0000000..a870b79 --- /dev/null +++ b/src/cudo_compute/models/user_permission.py @@ -0,0 +1,232 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class UserPermission(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'permission_role': 'Role', + 'role': 'str', + 'user_email': 'str', + 'user_id': 'str', + 'user_picture': 'str' + } + + attribute_map = { + 'permission_role': 'permissionRole', + 'role': 'role', + 'user_email': 'userEmail', + 'user_id': 'userId', + 'user_picture': 'userPicture' + } + + def __init__(self, permission_role=None, role=None, user_email=None, user_id=None, user_picture=None, _configuration=None): # noqa: E501 + """UserPermission - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._permission_role = None + self._role = None + self._user_email = None + self._user_id = None + self._user_picture = None + self.discriminator = None + + self.permission_role = permission_role + self.role = role + self.user_email = user_email + self.user_id = user_id + self.user_picture = user_picture + + @property + def permission_role(self): + """Gets the permission_role of this UserPermission. # noqa: E501 + + + :return: The permission_role of this UserPermission. # noqa: E501 + :rtype: Role + """ + return self._permission_role + + @permission_role.setter + def permission_role(self, permission_role): + """Sets the permission_role of this UserPermission. + + + :param permission_role: The permission_role of this UserPermission. # noqa: E501 + :type: Role + """ + if self._configuration.client_side_validation and permission_role is None: + raise ValueError("Invalid value for `permission_role`, must not be `None`") # noqa: E501 + + self._permission_role = permission_role + + @property + def role(self): + """Gets the role of this UserPermission. # noqa: E501 + + + :return: The role of this UserPermission. # noqa: E501 + :rtype: str + """ + return self._role + + @role.setter + def role(self, role): + """Sets the role of this UserPermission. + + + :param role: The role of this UserPermission. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and role is None: + raise ValueError("Invalid value for `role`, must not be `None`") # noqa: E501 + + self._role = role + + @property + def user_email(self): + """Gets the user_email of this UserPermission. # noqa: E501 + + + :return: The user_email of this UserPermission. # noqa: E501 + :rtype: str + """ + return self._user_email + + @user_email.setter + def user_email(self, user_email): + """Sets the user_email of this UserPermission. + + + :param user_email: The user_email of this UserPermission. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and user_email is None: + raise ValueError("Invalid value for `user_email`, must not be `None`") # noqa: E501 + + self._user_email = user_email + + @property + def user_id(self): + """Gets the user_id of this UserPermission. # noqa: E501 + + + :return: The user_id of this UserPermission. # noqa: E501 + :rtype: str + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this UserPermission. + + + :param user_id: The user_id of this UserPermission. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and user_id is None: + raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501 + + self._user_id = user_id + + @property + def user_picture(self): + """Gets the user_picture of this UserPermission. # noqa: E501 + + + :return: The user_picture of this UserPermission. # noqa: E501 + :rtype: str + """ + return self._user_picture + + @user_picture.setter + def user_picture(self, user_picture): + """Sets the user_picture of this UserPermission. + + + :param user_picture: The user_picture of this UserPermission. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and user_picture is None: + raise ValueError("Invalid value for `user_picture`, must not be `None`") # noqa: E501 + + self._user_picture = user_picture + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UserPermission, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UserPermission): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UserPermission): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/v1_private_image.py b/src/cudo_compute/models/v1_private_image.py new file mode 100644 index 0000000..b6dc643 --- /dev/null +++ b/src/cudo_compute/models/v1_private_image.py @@ -0,0 +1,227 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class V1PrivateImage(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data_center_id': 'str', + 'description': 'str', + 'id': 'str', + 'project_id': 'str', + 'size_gib': 'int' + } + + attribute_map = { + 'data_center_id': 'dataCenterId', + 'description': 'description', + 'id': 'id', + 'project_id': 'projectId', + 'size_gib': 'sizeGib' + } + + def __init__(self, data_center_id=None, description=None, id=None, project_id=None, size_gib=None, _configuration=None): # noqa: E501 + """V1PrivateImage - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._data_center_id = None + self._description = None + self._id = None + self._project_id = None + self._size_gib = None + self.discriminator = None + + if data_center_id is not None: + self.data_center_id = data_center_id + if description is not None: + self.description = description + if id is not None: + self.id = id + if project_id is not None: + self.project_id = project_id + if size_gib is not None: + self.size_gib = size_gib + + @property + def data_center_id(self): + """Gets the data_center_id of this V1PrivateImage. # noqa: E501 + + + :return: The data_center_id of this V1PrivateImage. # noqa: E501 + :rtype: str + """ + return self._data_center_id + + @data_center_id.setter + def data_center_id(self, data_center_id): + """Sets the data_center_id of this V1PrivateImage. + + + :param data_center_id: The data_center_id of this V1PrivateImage. # noqa: E501 + :type: str + """ + + self._data_center_id = data_center_id + + @property + def description(self): + """Gets the description of this V1PrivateImage. # noqa: E501 + + + :return: The description of this V1PrivateImage. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this V1PrivateImage. + + + :param description: The description of this V1PrivateImage. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def id(self): + """Gets the id of this V1PrivateImage. # noqa: E501 + + + :return: The id of this V1PrivateImage. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this V1PrivateImage. + + + :param id: The id of this V1PrivateImage. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def project_id(self): + """Gets the project_id of this V1PrivateImage. # noqa: E501 + + + :return: The project_id of this V1PrivateImage. # noqa: E501 + :rtype: str + """ + return self._project_id + + @project_id.setter + def project_id(self, project_id): + """Sets the project_id of this V1PrivateImage. + + + :param project_id: The project_id of this V1PrivateImage. # noqa: E501 + :type: str + """ + + self._project_id = project_id + + @property + def size_gib(self): + """Gets the size_gib of this V1PrivateImage. # noqa: E501 + + + :return: The size_gib of this V1PrivateImage. # noqa: E501 + :rtype: int + """ + return self._size_gib + + @size_gib.setter + def size_gib(self, size_gib): + """Sets the size_gib of this V1PrivateImage. + + + :param size_gib: The size_gib of this V1PrivateImage. # noqa: E501 + :type: int + """ + + self._size_gib = size_gib + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(V1PrivateImage, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1PrivateImage): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1PrivateImage): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/v_router_size.py b/src/cudo_compute/models/v_router_size.py new file mode 100644 index 0000000..e8b9096 --- /dev/null +++ b/src/cudo_compute/models/v_router_size.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class VRouterSize(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + UNKNOWN = "VROUTER_INSTANCE_UNKNOWN" + SMALL = "VROUTER_INSTANCE_SMALL" + MEDIUM = "VROUTER_INSTANCE_MEDIUM" + LARGE = "VROUTER_INSTANCE_LARGE" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """VRouterSize - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(VRouterSize, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, VRouterSize): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, VRouterSize): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/vm.py b/src/cudo_compute/models/vm.py new file mode 100644 index 0000000..13cfa25 --- /dev/null +++ b/src/cudo_compute/models/vm.py @@ -0,0 +1,955 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class VM(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'active_state': 'str', + 'boot_disk': 'Disk', + 'boot_disk_size_gib': 'int', + 'cpu_model': 'str', + 'create_by': 'str', + 'datacenter_id': 'str', + 'external_ip_address': 'str', + 'gpu_model': 'str', + 'gpu_quantity': 'int', + 'id': 'str', + 'image_id': 'str', + 'image_name': 'str', + 'init_state': 'str', + 'internal_ip_address': 'str', + 'lcm_state': 'str', + 'machine_type': 'str', + 'memory': 'int', + 'metadata': 'dict(str, str)', + 'nics': 'list[VMNIC]', + 'one_state': 'str', + 'price_hr': 'float', + 'private_image_id': 'str', + 'public_image_id': 'str', + 'public_image_name': 'str', + 'public_ip_address': 'str', + 'region_id': 'str', + 'region_name': 'str', + 'renewable_energy': 'bool', + 'rules': 'list[SecurityGroupRule]', + 'security_group_ids': 'list[str]', + 'short_state': 'str', + 'storage_disks': 'list[Disk]', + 'vcpus': 'int' + } + + attribute_map = { + 'active_state': 'activeState', + 'boot_disk': 'bootDisk', + 'boot_disk_size_gib': 'bootDiskSizeGib', + 'cpu_model': 'cpuModel', + 'create_by': 'createBy', + 'datacenter_id': 'datacenterId', + 'external_ip_address': 'externalIpAddress', + 'gpu_model': 'gpuModel', + 'gpu_quantity': 'gpuQuantity', + 'id': 'id', + 'image_id': 'imageId', + 'image_name': 'imageName', + 'init_state': 'initState', + 'internal_ip_address': 'internalIpAddress', + 'lcm_state': 'lcmState', + 'machine_type': 'machineType', + 'memory': 'memory', + 'metadata': 'metadata', + 'nics': 'nics', + 'one_state': 'oneState', + 'price_hr': 'priceHr', + 'private_image_id': 'privateImageId', + 'public_image_id': 'publicImageId', + 'public_image_name': 'publicImageName', + 'public_ip_address': 'publicIpAddress', + 'region_id': 'regionId', + 'region_name': 'regionName', + 'renewable_energy': 'renewableEnergy', + 'rules': 'rules', + 'security_group_ids': 'securityGroupIds', + 'short_state': 'shortState', + 'storage_disks': 'storageDisks', + 'vcpus': 'vcpus' + } + + def __init__(self, active_state=None, boot_disk=None, boot_disk_size_gib=None, cpu_model=None, create_by=None, datacenter_id=None, external_ip_address=None, gpu_model=None, gpu_quantity=None, id=None, image_id=None, image_name=None, init_state=None, internal_ip_address=None, lcm_state=None, machine_type=None, memory=None, metadata=None, nics=None, one_state=None, price_hr=None, private_image_id=None, public_image_id=None, public_image_name=None, public_ip_address=None, region_id=None, region_name=None, renewable_energy=None, rules=None, security_group_ids=None, short_state=None, storage_disks=None, vcpus=None, _configuration=None): # noqa: E501 + """VM - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._active_state = None + self._boot_disk = None + self._boot_disk_size_gib = None + self._cpu_model = None + self._create_by = None + self._datacenter_id = None + self._external_ip_address = None + self._gpu_model = None + self._gpu_quantity = None + self._id = None + self._image_id = None + self._image_name = None + self._init_state = None + self._internal_ip_address = None + self._lcm_state = None + self._machine_type = None + self._memory = None + self._metadata = None + self._nics = None + self._one_state = None + self._price_hr = None + self._private_image_id = None + self._public_image_id = None + self._public_image_name = None + self._public_ip_address = None + self._region_id = None + self._region_name = None + self._renewable_energy = None + self._rules = None + self._security_group_ids = None + self._short_state = None + self._storage_disks = None + self._vcpus = None + self.discriminator = None + + if active_state is not None: + self.active_state = active_state + if boot_disk is not None: + self.boot_disk = boot_disk + if boot_disk_size_gib is not None: + self.boot_disk_size_gib = boot_disk_size_gib + if cpu_model is not None: + self.cpu_model = cpu_model + if create_by is not None: + self.create_by = create_by + if datacenter_id is not None: + self.datacenter_id = datacenter_id + if external_ip_address is not None: + self.external_ip_address = external_ip_address + if gpu_model is not None: + self.gpu_model = gpu_model + if gpu_quantity is not None: + self.gpu_quantity = gpu_quantity + if id is not None: + self.id = id + if image_id is not None: + self.image_id = image_id + if image_name is not None: + self.image_name = image_name + if init_state is not None: + self.init_state = init_state + if internal_ip_address is not None: + self.internal_ip_address = internal_ip_address + if lcm_state is not None: + self.lcm_state = lcm_state + if machine_type is not None: + self.machine_type = machine_type + if memory is not None: + self.memory = memory + if metadata is not None: + self.metadata = metadata + if nics is not None: + self.nics = nics + if one_state is not None: + self.one_state = one_state + if price_hr is not None: + self.price_hr = price_hr + if private_image_id is not None: + self.private_image_id = private_image_id + if public_image_id is not None: + self.public_image_id = public_image_id + if public_image_name is not None: + self.public_image_name = public_image_name + if public_ip_address is not None: + self.public_ip_address = public_ip_address + if region_id is not None: + self.region_id = region_id + if region_name is not None: + self.region_name = region_name + if renewable_energy is not None: + self.renewable_energy = renewable_energy + if rules is not None: + self.rules = rules + if security_group_ids is not None: + self.security_group_ids = security_group_ids + if short_state is not None: + self.short_state = short_state + if storage_disks is not None: + self.storage_disks = storage_disks + if vcpus is not None: + self.vcpus = vcpus + + @property + def active_state(self): + """Gets the active_state of this VM. # noqa: E501 + + + :return: The active_state of this VM. # noqa: E501 + :rtype: str + """ + return self._active_state + + @active_state.setter + def active_state(self, active_state): + """Sets the active_state of this VM. + + + :param active_state: The active_state of this VM. # noqa: E501 + :type: str + """ + + self._active_state = active_state + + @property + def boot_disk(self): + """Gets the boot_disk of this VM. # noqa: E501 + + + :return: The boot_disk of this VM. # noqa: E501 + :rtype: Disk + """ + return self._boot_disk + + @boot_disk.setter + def boot_disk(self, boot_disk): + """Sets the boot_disk of this VM. + + + :param boot_disk: The boot_disk of this VM. # noqa: E501 + :type: Disk + """ + + self._boot_disk = boot_disk + + @property + def boot_disk_size_gib(self): + """Gets the boot_disk_size_gib of this VM. # noqa: E501 + + + :return: The boot_disk_size_gib of this VM. # noqa: E501 + :rtype: int + """ + return self._boot_disk_size_gib + + @boot_disk_size_gib.setter + def boot_disk_size_gib(self, boot_disk_size_gib): + """Sets the boot_disk_size_gib of this VM. + + + :param boot_disk_size_gib: The boot_disk_size_gib of this VM. # noqa: E501 + :type: int + """ + + self._boot_disk_size_gib = boot_disk_size_gib + + @property + def cpu_model(self): + """Gets the cpu_model of this VM. # noqa: E501 + + + :return: The cpu_model of this VM. # noqa: E501 + :rtype: str + """ + return self._cpu_model + + @cpu_model.setter + def cpu_model(self, cpu_model): + """Sets the cpu_model of this VM. + + + :param cpu_model: The cpu_model of this VM. # noqa: E501 + :type: str + """ + + self._cpu_model = cpu_model + + @property + def create_by(self): + """Gets the create_by of this VM. # noqa: E501 + + + :return: The create_by of this VM. # noqa: E501 + :rtype: str + """ + return self._create_by + + @create_by.setter + def create_by(self, create_by): + """Sets the create_by of this VM. + + + :param create_by: The create_by of this VM. # noqa: E501 + :type: str + """ + + self._create_by = create_by + + @property + def datacenter_id(self): + """Gets the datacenter_id of this VM. # noqa: E501 + + + :return: The datacenter_id of this VM. # noqa: E501 + :rtype: str + """ + return self._datacenter_id + + @datacenter_id.setter + def datacenter_id(self, datacenter_id): + """Sets the datacenter_id of this VM. + + + :param datacenter_id: The datacenter_id of this VM. # noqa: E501 + :type: str + """ + + self._datacenter_id = datacenter_id + + @property + def external_ip_address(self): + """Gets the external_ip_address of this VM. # noqa: E501 + + + :return: The external_ip_address of this VM. # noqa: E501 + :rtype: str + """ + return self._external_ip_address + + @external_ip_address.setter + def external_ip_address(self, external_ip_address): + """Sets the external_ip_address of this VM. + + + :param external_ip_address: The external_ip_address of this VM. # noqa: E501 + :type: str + """ + + self._external_ip_address = external_ip_address + + @property + def gpu_model(self): + """Gets the gpu_model of this VM. # noqa: E501 + + + :return: The gpu_model of this VM. # noqa: E501 + :rtype: str + """ + return self._gpu_model + + @gpu_model.setter + def gpu_model(self, gpu_model): + """Sets the gpu_model of this VM. + + + :param gpu_model: The gpu_model of this VM. # noqa: E501 + :type: str + """ + + self._gpu_model = gpu_model + + @property + def gpu_quantity(self): + """Gets the gpu_quantity of this VM. # noqa: E501 + + + :return: The gpu_quantity of this VM. # noqa: E501 + :rtype: int + """ + return self._gpu_quantity + + @gpu_quantity.setter + def gpu_quantity(self, gpu_quantity): + """Sets the gpu_quantity of this VM. + + + :param gpu_quantity: The gpu_quantity of this VM. # noqa: E501 + :type: int + """ + + self._gpu_quantity = gpu_quantity + + @property + def id(self): + """Gets the id of this VM. # noqa: E501 + + + :return: The id of this VM. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this VM. + + + :param id: The id of this VM. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def image_id(self): + """Gets the image_id of this VM. # noqa: E501 + + + :return: The image_id of this VM. # noqa: E501 + :rtype: str + """ + return self._image_id + + @image_id.setter + def image_id(self, image_id): + """Sets the image_id of this VM. + + + :param image_id: The image_id of this VM. # noqa: E501 + :type: str + """ + + self._image_id = image_id + + @property + def image_name(self): + """Gets the image_name of this VM. # noqa: E501 + + + :return: The image_name of this VM. # noqa: E501 + :rtype: str + """ + return self._image_name + + @image_name.setter + def image_name(self, image_name): + """Sets the image_name of this VM. + + + :param image_name: The image_name of this VM. # noqa: E501 + :type: str + """ + + self._image_name = image_name + + @property + def init_state(self): + """Gets the init_state of this VM. # noqa: E501 + + + :return: The init_state of this VM. # noqa: E501 + :rtype: str + """ + return self._init_state + + @init_state.setter + def init_state(self, init_state): + """Sets the init_state of this VM. + + + :param init_state: The init_state of this VM. # noqa: E501 + :type: str + """ + + self._init_state = init_state + + @property + def internal_ip_address(self): + """Gets the internal_ip_address of this VM. # noqa: E501 + + + :return: The internal_ip_address of this VM. # noqa: E501 + :rtype: str + """ + return self._internal_ip_address + + @internal_ip_address.setter + def internal_ip_address(self, internal_ip_address): + """Sets the internal_ip_address of this VM. + + + :param internal_ip_address: The internal_ip_address of this VM. # noqa: E501 + :type: str + """ + + self._internal_ip_address = internal_ip_address + + @property + def lcm_state(self): + """Gets the lcm_state of this VM. # noqa: E501 + + + :return: The lcm_state of this VM. # noqa: E501 + :rtype: str + """ + return self._lcm_state + + @lcm_state.setter + def lcm_state(self, lcm_state): + """Sets the lcm_state of this VM. + + + :param lcm_state: The lcm_state of this VM. # noqa: E501 + :type: str + """ + + self._lcm_state = lcm_state + + @property + def machine_type(self): + """Gets the machine_type of this VM. # noqa: E501 + + + :return: The machine_type of this VM. # noqa: E501 + :rtype: str + """ + return self._machine_type + + @machine_type.setter + def machine_type(self, machine_type): + """Sets the machine_type of this VM. + + + :param machine_type: The machine_type of this VM. # noqa: E501 + :type: str + """ + + self._machine_type = machine_type + + @property + def memory(self): + """Gets the memory of this VM. # noqa: E501 + + + :return: The memory of this VM. # noqa: E501 + :rtype: int + """ + return self._memory + + @memory.setter + def memory(self, memory): + """Sets the memory of this VM. + + + :param memory: The memory of this VM. # noqa: E501 + :type: int + """ + + self._memory = memory + + @property + def metadata(self): + """Gets the metadata of this VM. # noqa: E501 + + + :return: The metadata of this VM. # noqa: E501 + :rtype: dict(str, str) + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this VM. + + + :param metadata: The metadata of this VM. # noqa: E501 + :type: dict(str, str) + """ + + self._metadata = metadata + + @property + def nics(self): + """Gets the nics of this VM. # noqa: E501 + + + :return: The nics of this VM. # noqa: E501 + :rtype: list[VMNIC] + """ + return self._nics + + @nics.setter + def nics(self, nics): + """Sets the nics of this VM. + + + :param nics: The nics of this VM. # noqa: E501 + :type: list[VMNIC] + """ + + self._nics = nics + + @property + def one_state(self): + """Gets the one_state of this VM. # noqa: E501 + + + :return: The one_state of this VM. # noqa: E501 + :rtype: str + """ + return self._one_state + + @one_state.setter + def one_state(self, one_state): + """Sets the one_state of this VM. + + + :param one_state: The one_state of this VM. # noqa: E501 + :type: str + """ + + self._one_state = one_state + + @property + def price_hr(self): + """Gets the price_hr of this VM. # noqa: E501 + + + :return: The price_hr of this VM. # noqa: E501 + :rtype: float + """ + return self._price_hr + + @price_hr.setter + def price_hr(self, price_hr): + """Sets the price_hr of this VM. + + + :param price_hr: The price_hr of this VM. # noqa: E501 + :type: float + """ + + self._price_hr = price_hr + + @property + def private_image_id(self): + """Gets the private_image_id of this VM. # noqa: E501 + + + :return: The private_image_id of this VM. # noqa: E501 + :rtype: str + """ + return self._private_image_id + + @private_image_id.setter + def private_image_id(self, private_image_id): + """Sets the private_image_id of this VM. + + + :param private_image_id: The private_image_id of this VM. # noqa: E501 + :type: str + """ + + self._private_image_id = private_image_id + + @property + def public_image_id(self): + """Gets the public_image_id of this VM. # noqa: E501 + + + :return: The public_image_id of this VM. # noqa: E501 + :rtype: str + """ + return self._public_image_id + + @public_image_id.setter + def public_image_id(self, public_image_id): + """Sets the public_image_id of this VM. + + + :param public_image_id: The public_image_id of this VM. # noqa: E501 + :type: str + """ + + self._public_image_id = public_image_id + + @property + def public_image_name(self): + """Gets the public_image_name of this VM. # noqa: E501 + + + :return: The public_image_name of this VM. # noqa: E501 + :rtype: str + """ + return self._public_image_name + + @public_image_name.setter + def public_image_name(self, public_image_name): + """Sets the public_image_name of this VM. + + + :param public_image_name: The public_image_name of this VM. # noqa: E501 + :type: str + """ + + self._public_image_name = public_image_name + + @property + def public_ip_address(self): + """Gets the public_ip_address of this VM. # noqa: E501 + + + :return: The public_ip_address of this VM. # noqa: E501 + :rtype: str + """ + return self._public_ip_address + + @public_ip_address.setter + def public_ip_address(self, public_ip_address): + """Sets the public_ip_address of this VM. + + + :param public_ip_address: The public_ip_address of this VM. # noqa: E501 + :type: str + """ + + self._public_ip_address = public_ip_address + + @property + def region_id(self): + """Gets the region_id of this VM. # noqa: E501 + + + :return: The region_id of this VM. # noqa: E501 + :rtype: str + """ + return self._region_id + + @region_id.setter + def region_id(self, region_id): + """Sets the region_id of this VM. + + + :param region_id: The region_id of this VM. # noqa: E501 + :type: str + """ + + self._region_id = region_id + + @property + def region_name(self): + """Gets the region_name of this VM. # noqa: E501 + + + :return: The region_name of this VM. # noqa: E501 + :rtype: str + """ + return self._region_name + + @region_name.setter + def region_name(self, region_name): + """Sets the region_name of this VM. + + + :param region_name: The region_name of this VM. # noqa: E501 + :type: str + """ + + self._region_name = region_name + + @property + def renewable_energy(self): + """Gets the renewable_energy of this VM. # noqa: E501 + + + :return: The renewable_energy of this VM. # noqa: E501 + :rtype: bool + """ + return self._renewable_energy + + @renewable_energy.setter + def renewable_energy(self, renewable_energy): + """Sets the renewable_energy of this VM. + + + :param renewable_energy: The renewable_energy of this VM. # noqa: E501 + :type: bool + """ + + self._renewable_energy = renewable_energy + + @property + def rules(self): + """Gets the rules of this VM. # noqa: E501 + + + :return: The rules of this VM. # noqa: E501 + :rtype: list[SecurityGroupRule] + """ + return self._rules + + @rules.setter + def rules(self, rules): + """Sets the rules of this VM. + + + :param rules: The rules of this VM. # noqa: E501 + :type: list[SecurityGroupRule] + """ + + self._rules = rules + + @property + def security_group_ids(self): + """Gets the security_group_ids of this VM. # noqa: E501 + + + :return: The security_group_ids of this VM. # noqa: E501 + :rtype: list[str] + """ + return self._security_group_ids + + @security_group_ids.setter + def security_group_ids(self, security_group_ids): + """Sets the security_group_ids of this VM. + + + :param security_group_ids: The security_group_ids of this VM. # noqa: E501 + :type: list[str] + """ + + self._security_group_ids = security_group_ids + + @property + def short_state(self): + """Gets the short_state of this VM. # noqa: E501 + + + :return: The short_state of this VM. # noqa: E501 + :rtype: str + """ + return self._short_state + + @short_state.setter + def short_state(self, short_state): + """Sets the short_state of this VM. + + + :param short_state: The short_state of this VM. # noqa: E501 + :type: str + """ + + self._short_state = short_state + + @property + def storage_disks(self): + """Gets the storage_disks of this VM. # noqa: E501 + + + :return: The storage_disks of this VM. # noqa: E501 + :rtype: list[Disk] + """ + return self._storage_disks + + @storage_disks.setter + def storage_disks(self, storage_disks): + """Sets the storage_disks of this VM. + + + :param storage_disks: The storage_disks of this VM. # noqa: E501 + :type: list[Disk] + """ + + self._storage_disks = storage_disks + + @property + def vcpus(self): + """Gets the vcpus of this VM. # noqa: E501 + + + :return: The vcpus of this VM. # noqa: E501 + :rtype: int + """ + return self._vcpus + + @vcpus.setter + def vcpus(self, vcpus): + """Sets the vcpus of this VM. + + + :param vcpus: The vcpus of this VM. # noqa: E501 + :type: int + """ + + self._vcpus = vcpus + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(VM, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, VM): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, VM): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/vm_data_center.py b/src/cudo_compute/models/vm_data_center.py new file mode 100644 index 0000000..1819efa --- /dev/null +++ b/src/cudo_compute/models/vm_data_center.py @@ -0,0 +1,283 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class VMDataCenter(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'disk_pool_pricing': 'list[DiskStoragePriceHr]', + 'id': 'str', + 'ipv4_price_hr': 'Decimal', + 'network_pricing': 'list[NetworkPriceHr]', + 'region_id': 'str', + 'renewable_energy': 'bool', + 'supplier_name': 'str' + } + + attribute_map = { + 'disk_pool_pricing': 'diskPoolPricing', + 'id': 'id', + 'ipv4_price_hr': 'ipv4PriceHr', + 'network_pricing': 'networkPricing', + 'region_id': 'regionId', + 'renewable_energy': 'renewableEnergy', + 'supplier_name': 'supplierName' + } + + def __init__(self, disk_pool_pricing=None, id=None, ipv4_price_hr=None, network_pricing=None, region_id=None, renewable_energy=None, supplier_name=None, _configuration=None): # noqa: E501 + """VMDataCenter - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._disk_pool_pricing = None + self._id = None + self._ipv4_price_hr = None + self._network_pricing = None + self._region_id = None + self._renewable_energy = None + self._supplier_name = None + self.discriminator = None + + if disk_pool_pricing is not None: + self.disk_pool_pricing = disk_pool_pricing + self.id = id + if ipv4_price_hr is not None: + self.ipv4_price_hr = ipv4_price_hr + if network_pricing is not None: + self.network_pricing = network_pricing + self.region_id = region_id + self.renewable_energy = renewable_energy + self.supplier_name = supplier_name + + @property + def disk_pool_pricing(self): + """Gets the disk_pool_pricing of this VMDataCenter. # noqa: E501 + + + :return: The disk_pool_pricing of this VMDataCenter. # noqa: E501 + :rtype: list[DiskStoragePriceHr] + """ + return self._disk_pool_pricing + + @disk_pool_pricing.setter + def disk_pool_pricing(self, disk_pool_pricing): + """Sets the disk_pool_pricing of this VMDataCenter. + + + :param disk_pool_pricing: The disk_pool_pricing of this VMDataCenter. # noqa: E501 + :type: list[DiskStoragePriceHr] + """ + + self._disk_pool_pricing = disk_pool_pricing + + @property + def id(self): + """Gets the id of this VMDataCenter. # noqa: E501 + + + :return: The id of this VMDataCenter. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this VMDataCenter. + + + :param id: The id of this VMDataCenter. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def ipv4_price_hr(self): + """Gets the ipv4_price_hr of this VMDataCenter. # noqa: E501 + + + :return: The ipv4_price_hr of this VMDataCenter. # noqa: E501 + :rtype: Decimal + """ + return self._ipv4_price_hr + + @ipv4_price_hr.setter + def ipv4_price_hr(self, ipv4_price_hr): + """Sets the ipv4_price_hr of this VMDataCenter. + + + :param ipv4_price_hr: The ipv4_price_hr of this VMDataCenter. # noqa: E501 + :type: Decimal + """ + + self._ipv4_price_hr = ipv4_price_hr + + @property + def network_pricing(self): + """Gets the network_pricing of this VMDataCenter. # noqa: E501 + + + :return: The network_pricing of this VMDataCenter. # noqa: E501 + :rtype: list[NetworkPriceHr] + """ + return self._network_pricing + + @network_pricing.setter + def network_pricing(self, network_pricing): + """Sets the network_pricing of this VMDataCenter. + + + :param network_pricing: The network_pricing of this VMDataCenter. # noqa: E501 + :type: list[NetworkPriceHr] + """ + + self._network_pricing = network_pricing + + @property + def region_id(self): + """Gets the region_id of this VMDataCenter. # noqa: E501 + + + :return: The region_id of this VMDataCenter. # noqa: E501 + :rtype: str + """ + return self._region_id + + @region_id.setter + def region_id(self, region_id): + """Sets the region_id of this VMDataCenter. + + + :param region_id: The region_id of this VMDataCenter. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and region_id is None: + raise ValueError("Invalid value for `region_id`, must not be `None`") # noqa: E501 + + self._region_id = region_id + + @property + def renewable_energy(self): + """Gets the renewable_energy of this VMDataCenter. # noqa: E501 + + + :return: The renewable_energy of this VMDataCenter. # noqa: E501 + :rtype: bool + """ + return self._renewable_energy + + @renewable_energy.setter + def renewable_energy(self, renewable_energy): + """Sets the renewable_energy of this VMDataCenter. + + + :param renewable_energy: The renewable_energy of this VMDataCenter. # noqa: E501 + :type: bool + """ + if self._configuration.client_side_validation and renewable_energy is None: + raise ValueError("Invalid value for `renewable_energy`, must not be `None`") # noqa: E501 + + self._renewable_energy = renewable_energy + + @property + def supplier_name(self): + """Gets the supplier_name of this VMDataCenter. # noqa: E501 + + + :return: The supplier_name of this VMDataCenter. # noqa: E501 + :rtype: str + """ + return self._supplier_name + + @supplier_name.setter + def supplier_name(self, supplier_name): + """Sets the supplier_name of this VMDataCenter. + + + :param supplier_name: The supplier_name of this VMDataCenter. # noqa: E501 + :type: str + """ + if self._configuration.client_side_validation and supplier_name is None: + raise ValueError("Invalid value for `supplier_name`, must not be `None`") # noqa: E501 + + self._supplier_name = supplier_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(VMDataCenter, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, VMDataCenter): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, VMDataCenter): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/vm_data_center_storage_class.py b/src/cudo_compute/models/vm_data_center_storage_class.py new file mode 100644 index 0000000..ee8a5f9 --- /dev/null +++ b/src/cudo_compute/models/vm_data_center_storage_class.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class VMDataCenterStorageClass(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + UNKNOWN = "STORAGE_CLASS_UNKNOWN" + LOCAL = "STORAGE_CLASS_LOCAL" + NETWORK = "STORAGE_CLASS_NETWORK" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """VMDataCenterStorageClass - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(VMDataCenterStorageClass, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, VMDataCenterStorageClass): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, VMDataCenterStorageClass): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/vm_monitoring_item.py b/src/cudo_compute/models/vm_monitoring_item.py new file mode 100644 index 0000000..9fa391e --- /dev/null +++ b/src/cudo_compute/models/vm_monitoring_item.py @@ -0,0 +1,331 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class VMMonitoringItem(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'cpu': 'float', + 'disk_rd_bytes': 'int', + 'disk_rd_iops': 'int', + 'disk_wr_bytes': 'int', + 'disk_wr_iops': 'int', + 'memory': 'int', + 'net_rx': 'int', + 'net_tx': 'int', + 'timestamp': 'str' + } + + attribute_map = { + 'cpu': 'cpu', + 'disk_rd_bytes': 'diskRdBytes', + 'disk_rd_iops': 'diskRdIops', + 'disk_wr_bytes': 'diskWrBytes', + 'disk_wr_iops': 'diskWrIops', + 'memory': 'memory', + 'net_rx': 'netRx', + 'net_tx': 'netTx', + 'timestamp': 'timestamp' + } + + def __init__(self, cpu=None, disk_rd_bytes=None, disk_rd_iops=None, disk_wr_bytes=None, disk_wr_iops=None, memory=None, net_rx=None, net_tx=None, timestamp=None, _configuration=None): # noqa: E501 + """VMMonitoringItem - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._cpu = None + self._disk_rd_bytes = None + self._disk_rd_iops = None + self._disk_wr_bytes = None + self._disk_wr_iops = None + self._memory = None + self._net_rx = None + self._net_tx = None + self._timestamp = None + self.discriminator = None + + if cpu is not None: + self.cpu = cpu + if disk_rd_bytes is not None: + self.disk_rd_bytes = disk_rd_bytes + if disk_rd_iops is not None: + self.disk_rd_iops = disk_rd_iops + if disk_wr_bytes is not None: + self.disk_wr_bytes = disk_wr_bytes + if disk_wr_iops is not None: + self.disk_wr_iops = disk_wr_iops + if memory is not None: + self.memory = memory + if net_rx is not None: + self.net_rx = net_rx + if net_tx is not None: + self.net_tx = net_tx + if timestamp is not None: + self.timestamp = timestamp + + @property + def cpu(self): + """Gets the cpu of this VMMonitoringItem. # noqa: E501 + + + :return: The cpu of this VMMonitoringItem. # noqa: E501 + :rtype: float + """ + return self._cpu + + @cpu.setter + def cpu(self, cpu): + """Sets the cpu of this VMMonitoringItem. + + + :param cpu: The cpu of this VMMonitoringItem. # noqa: E501 + :type: float + """ + + self._cpu = cpu + + @property + def disk_rd_bytes(self): + """Gets the disk_rd_bytes of this VMMonitoringItem. # noqa: E501 + + + :return: The disk_rd_bytes of this VMMonitoringItem. # noqa: E501 + :rtype: int + """ + return self._disk_rd_bytes + + @disk_rd_bytes.setter + def disk_rd_bytes(self, disk_rd_bytes): + """Sets the disk_rd_bytes of this VMMonitoringItem. + + + :param disk_rd_bytes: The disk_rd_bytes of this VMMonitoringItem. # noqa: E501 + :type: int + """ + + self._disk_rd_bytes = disk_rd_bytes + + @property + def disk_rd_iops(self): + """Gets the disk_rd_iops of this VMMonitoringItem. # noqa: E501 + + + :return: The disk_rd_iops of this VMMonitoringItem. # noqa: E501 + :rtype: int + """ + return self._disk_rd_iops + + @disk_rd_iops.setter + def disk_rd_iops(self, disk_rd_iops): + """Sets the disk_rd_iops of this VMMonitoringItem. + + + :param disk_rd_iops: The disk_rd_iops of this VMMonitoringItem. # noqa: E501 + :type: int + """ + + self._disk_rd_iops = disk_rd_iops + + @property + def disk_wr_bytes(self): + """Gets the disk_wr_bytes of this VMMonitoringItem. # noqa: E501 + + + :return: The disk_wr_bytes of this VMMonitoringItem. # noqa: E501 + :rtype: int + """ + return self._disk_wr_bytes + + @disk_wr_bytes.setter + def disk_wr_bytes(self, disk_wr_bytes): + """Sets the disk_wr_bytes of this VMMonitoringItem. + + + :param disk_wr_bytes: The disk_wr_bytes of this VMMonitoringItem. # noqa: E501 + :type: int + """ + + self._disk_wr_bytes = disk_wr_bytes + + @property + def disk_wr_iops(self): + """Gets the disk_wr_iops of this VMMonitoringItem. # noqa: E501 + + + :return: The disk_wr_iops of this VMMonitoringItem. # noqa: E501 + :rtype: int + """ + return self._disk_wr_iops + + @disk_wr_iops.setter + def disk_wr_iops(self, disk_wr_iops): + """Sets the disk_wr_iops of this VMMonitoringItem. + + + :param disk_wr_iops: The disk_wr_iops of this VMMonitoringItem. # noqa: E501 + :type: int + """ + + self._disk_wr_iops = disk_wr_iops + + @property + def memory(self): + """Gets the memory of this VMMonitoringItem. # noqa: E501 + + + :return: The memory of this VMMonitoringItem. # noqa: E501 + :rtype: int + """ + return self._memory + + @memory.setter + def memory(self, memory): + """Sets the memory of this VMMonitoringItem. + + + :param memory: The memory of this VMMonitoringItem. # noqa: E501 + :type: int + """ + + self._memory = memory + + @property + def net_rx(self): + """Gets the net_rx of this VMMonitoringItem. # noqa: E501 + + + :return: The net_rx of this VMMonitoringItem. # noqa: E501 + :rtype: int + """ + return self._net_rx + + @net_rx.setter + def net_rx(self, net_rx): + """Sets the net_rx of this VMMonitoringItem. + + + :param net_rx: The net_rx of this VMMonitoringItem. # noqa: E501 + :type: int + """ + + self._net_rx = net_rx + + @property + def net_tx(self): + """Gets the net_tx of this VMMonitoringItem. # noqa: E501 + + + :return: The net_tx of this VMMonitoringItem. # noqa: E501 + :rtype: int + """ + return self._net_tx + + @net_tx.setter + def net_tx(self, net_tx): + """Sets the net_tx of this VMMonitoringItem. + + + :param net_tx: The net_tx of this VMMonitoringItem. # noqa: E501 + :type: int + """ + + self._net_tx = net_tx + + @property + def timestamp(self): + """Gets the timestamp of this VMMonitoringItem. # noqa: E501 + + + :return: The timestamp of this VMMonitoringItem. # noqa: E501 + :rtype: str + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this VMMonitoringItem. + + + :param timestamp: The timestamp of this VMMonitoringItem. # noqa: E501 + :type: str + """ + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(VMMonitoringItem, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, VMMonitoringItem): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, VMMonitoringItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/models/vmnic.py b/src/cudo_compute/models/vmnic.py new file mode 100644 index 0000000..19ec31c --- /dev/null +++ b/src/cudo_compute/models/vmnic.py @@ -0,0 +1,227 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from src.cudo_compute.configuration import Configuration + + +class VMNIC(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'external_ip_address': 'str', + 'internal_ip_address': 'str', + 'network_address': 'str', + 'network_id': 'str', + 'security_group_ids': 'list[str]' + } + + attribute_map = { + 'external_ip_address': 'externalIpAddress', + 'internal_ip_address': 'internalIpAddress', + 'network_address': 'networkAddress', + 'network_id': 'networkId', + 'security_group_ids': 'securityGroupIds' + } + + def __init__(self, external_ip_address=None, internal_ip_address=None, network_address=None, network_id=None, security_group_ids=None, _configuration=None): # noqa: E501 + """VMNIC - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._external_ip_address = None + self._internal_ip_address = None + self._network_address = None + self._network_id = None + self._security_group_ids = None + self.discriminator = None + + if external_ip_address is not None: + self.external_ip_address = external_ip_address + if internal_ip_address is not None: + self.internal_ip_address = internal_ip_address + if network_address is not None: + self.network_address = network_address + if network_id is not None: + self.network_id = network_id + if security_group_ids is not None: + self.security_group_ids = security_group_ids + + @property + def external_ip_address(self): + """Gets the external_ip_address of this VMNIC. # noqa: E501 + + + :return: The external_ip_address of this VMNIC. # noqa: E501 + :rtype: str + """ + return self._external_ip_address + + @external_ip_address.setter + def external_ip_address(self, external_ip_address): + """Sets the external_ip_address of this VMNIC. + + + :param external_ip_address: The external_ip_address of this VMNIC. # noqa: E501 + :type: str + """ + + self._external_ip_address = external_ip_address + + @property + def internal_ip_address(self): + """Gets the internal_ip_address of this VMNIC. # noqa: E501 + + + :return: The internal_ip_address of this VMNIC. # noqa: E501 + :rtype: str + """ + return self._internal_ip_address + + @internal_ip_address.setter + def internal_ip_address(self, internal_ip_address): + """Sets the internal_ip_address of this VMNIC. + + + :param internal_ip_address: The internal_ip_address of this VMNIC. # noqa: E501 + :type: str + """ + + self._internal_ip_address = internal_ip_address + + @property + def network_address(self): + """Gets the network_address of this VMNIC. # noqa: E501 + + + :return: The network_address of this VMNIC. # noqa: E501 + :rtype: str + """ + return self._network_address + + @network_address.setter + def network_address(self, network_address): + """Sets the network_address of this VMNIC. + + + :param network_address: The network_address of this VMNIC. # noqa: E501 + :type: str + """ + + self._network_address = network_address + + @property + def network_id(self): + """Gets the network_id of this VMNIC. # noqa: E501 + + + :return: The network_id of this VMNIC. # noqa: E501 + :rtype: str + """ + return self._network_id + + @network_id.setter + def network_id(self, network_id): + """Sets the network_id of this VMNIC. + + + :param network_id: The network_id of this VMNIC. # noqa: E501 + :type: str + """ + + self._network_id = network_id + + @property + def security_group_ids(self): + """Gets the security_group_ids of this VMNIC. # noqa: E501 + + + :return: The security_group_ids of this VMNIC. # noqa: E501 + :rtype: list[str] + """ + return self._security_group_ids + + @security_group_ids.setter + def security_group_ids(self, security_group_ids): + """Sets the security_group_ids of this VMNIC. + + + :param security_group_ids: The security_group_ids of this VMNIC. # noqa: E501 + :type: list[str] + """ + + self._security_group_ids = security_group_ids + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(VMNIC, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, VMNIC): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, VMNIC): + return True + + return self.to_dict() != other.to_dict() diff --git a/src/cudo_compute/rest.py b/src/cudo_compute/rest.py new file mode 100644 index 0000000..7884c47 --- /dev/null +++ b/src/cudo_compute/rest.py @@ -0,0 +1,323 @@ +# coding: utf-8 + +""" + Cudo Compute service + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode + +try: + import urllib3 +except ImportError: + raise ImportError('Swagger python client requires urllib3.') + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = '{}' + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # In the python 3, the response.data is bytes. + # we need to decode it to string. + if six.PY3: + r.data = r.data.decode('utf8') + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + +class ApiException(Exception): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message