Skip to content

Commit

Permalink
Update metadata fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JungleCatSW committed Jan 2, 2024
1 parent 809fa68 commit e620a46
Show file tree
Hide file tree
Showing 179 changed files with 488 additions and 493 deletions.
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ Class | Method | HTTP request | Description
- [UpdateBillingAccountBody](docs/UpdateBillingAccountBody.md)
- [UpdatePrivateVMImageResponse](docs/UpdatePrivateVMImageResponse.md)
- [UpdateSecurityGroupResponse](docs/UpdateSecurityGroupResponse.md)
- [UpdateVMMetadataBody](docs/UpdateVMMetadataBody.md)
- [UpdateVMMetadataResponse](docs/UpdateVMMetadataResponse.md)
- [UserPermission](docs/UserPermission.md)
- [V1PrivateImage](docs/V1PrivateImage.md)
Expand Down
11 changes: 11 additions & 0 deletions docs/docs/UpdateVMMetadataBody.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# UpdateVMMetadataBody

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**merge** | **bool** | | [optional]
**metadata** | **dict(str, str)** | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


10 changes: 4 additions & 6 deletions docs/docs/VirtualMachinesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **update_vm_metadata**
> UpdateVMMetadataResponse update_vm_metadata(project_id, id, metadata=metadata, merge=merge)
> UpdateVMMetadataResponse update_vm_metadata(project_id, id, update_vm_metadata_body)
Update VM metadata

Expand All @@ -1185,12 +1185,11 @@ from pprint import pprint
api_instance = src.cudo_compute.VirtualMachinesApi()
project_id = 'project_id_example' # str |
id = 'id_example' # str |
metadata = 'metadata_example' # str | This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18 (optional)
merge = true # bool | (optional)
update_vm_metadata_body = src.cudo_compute.UpdateVMMetadataBody() # UpdateVMMetadataBody |

try:
# Update VM metadata
api_response = api_instance.update_vm_metadata(project_id, id, metadata=metadata, merge=merge)
api_response = api_instance.update_vm_metadata(project_id, id, update_vm_metadata_body)
pprint(api_response)
except ApiException as e:
print("Exception when calling VirtualMachinesApi->update_vm_metadata: %s\n" % e)
Expand All @@ -1202,8 +1201,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**project_id** | **str**| |
**id** | **str**| |
**metadata** | **str**| This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18 | [optional]
**merge** | **bool**| | [optional]
**update_vm_metadata_body** | [**UpdateVMMetadataBody**](UpdateVMMetadataBody.md)| |

### Return type

Expand Down
2 changes: 1 addition & 1 deletion docs/src/cudo_compute/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

# import apis into sdk package
Expand Down Expand Up @@ -178,6 +177,7 @@
from src.cudo_compute.models.update_billing_account_body import UpdateBillingAccountBody
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.update_vm_metadata_body import UpdateVMMetadataBody
from src.cudo_compute.models.update_vm_metadata_response import UpdateVMMetadataResponse
from src.cudo_compute.models.user_permission import UserPermission
from src.cudo_compute.models.v1_private_image import V1PrivateImage
Expand Down
1 change: 0 additions & 1 deletion docs/src/cudo_compute/api/api_keys_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re # noqa: F401
Expand Down
1 change: 0 additions & 1 deletion docs/src/cudo_compute/api/billing_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re # noqa: F401
Expand Down
1 change: 0 additions & 1 deletion docs/src/cudo_compute/api/data_centers_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re # noqa: F401
Expand Down
1 change: 0 additions & 1 deletion docs/src/cudo_compute/api/disks_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re # noqa: F401
Expand Down
1 change: 0 additions & 1 deletion docs/src/cudo_compute/api/machine_types_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re # noqa: F401
Expand Down
1 change: 0 additions & 1 deletion docs/src/cudo_compute/api/networks_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re # noqa: F401
Expand Down
1 change: 0 additions & 1 deletion docs/src/cudo_compute/api/object_storage_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re # noqa: F401
Expand Down
1 change: 0 additions & 1 deletion docs/src/cudo_compute/api/permissions_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re # noqa: F401
Expand Down
1 change: 0 additions & 1 deletion docs/src/cudo_compute/api/projects_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re # noqa: F401
Expand Down
1 change: 0 additions & 1 deletion docs/src/cudo_compute/api/search_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re # noqa: F401
Expand Down
1 change: 0 additions & 1 deletion docs/src/cudo_compute/api/ssh_keys_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re # noqa: F401
Expand Down
1 change: 0 additions & 1 deletion docs/src/cudo_compute/api/user_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re # noqa: F401
Expand Down
31 changes: 15 additions & 16 deletions docs/src/cudo_compute/api/virtual_machines_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re # noqa: F401
Expand Down Expand Up @@ -2497,49 +2496,47 @@ def update_private_vm_image_with_http_info(self, project_id, id, **kwargs): # n
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

def update_vm_metadata(self, project_id, id, **kwargs): # noqa: E501
def update_vm_metadata(self, project_id, id, update_vm_metadata_body, **kwargs): # noqa: E501
"""Update VM metadata # 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_vm_metadata(project_id, id, async_req=True)
>>> thread = api.update_vm_metadata(project_id, id, update_vm_metadata_body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str project_id: (required)
:param str id: (required)
:param str metadata: This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
:param bool merge:
:param UpdateVMMetadataBody update_vm_metadata_body: (required)
:return: UpdateVMMetadataResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.update_vm_metadata_with_http_info(project_id, id, **kwargs) # noqa: E501
return self.update_vm_metadata_with_http_info(project_id, id, update_vm_metadata_body, **kwargs) # noqa: E501
else:
(data) = self.update_vm_metadata_with_http_info(project_id, id, **kwargs) # noqa: E501
(data) = self.update_vm_metadata_with_http_info(project_id, id, update_vm_metadata_body, **kwargs) # noqa: E501
return data

def update_vm_metadata_with_http_info(self, project_id, id, **kwargs): # noqa: E501
def update_vm_metadata_with_http_info(self, project_id, id, update_vm_metadata_body, **kwargs): # noqa: E501
"""Update VM metadata # 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_vm_metadata_with_http_info(project_id, id, async_req=True)
>>> thread = api.update_vm_metadata_with_http_info(project_id, id, update_vm_metadata_body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str project_id: (required)
:param str id: (required)
:param str metadata: This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
:param bool merge:
:param UpdateVMMetadataBody update_vm_metadata_body: (required)
:return: UpdateVMMetadataResponse
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['project_id', 'id', 'metadata', 'merge'] # noqa: E501
all_params = ['project_id', 'id', 'update_vm_metadata_body'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
Expand All @@ -2562,6 +2559,10 @@ def update_vm_metadata_with_http_info(self, project_id, id, **kwargs): # noqa:
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_vm_metadata`") # noqa: E501
# verify the required parameter 'update_vm_metadata_body' is set
if self.api_client.client_side_validation and ('update_vm_metadata_body' not in params or
params['update_vm_metadata_body'] is None): # noqa: E501
raise ValueError("Missing the required parameter `update_vm_metadata_body` when calling `update_vm_metadata`") # noqa: E501

collection_formats = {}

Expand All @@ -2572,17 +2573,15 @@ def update_vm_metadata_with_http_info(self, project_id, id, **kwargs): # noqa:
path_params['id'] = params['id'] # noqa: E501

query_params = []
if 'metadata' in params:
query_params.append(('metadata', params['metadata'])) # noqa: E501
if 'merge' in params:
query_params.append(('merge', params['merge'])) # noqa: E501

header_params = {}

form_params = []
local_var_files = {}

body_params = None
if 'update_vm_metadata_body' in params:
body_params = params['update_vm_metadata_body']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
Expand Down
1 change: 0 additions & 1 deletion docs/src/cudo_compute/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import datetime
Expand Down
1 change: 0 additions & 1 deletion docs/src/cudo_compute/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import copy
Expand Down
2 changes: 1 addition & 1 deletion docs/src/cudo_compute/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

# import models into model package
Expand Down Expand Up @@ -159,6 +158,7 @@
from src.cudo_compute.models.update_billing_account_body import UpdateBillingAccountBody
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.update_vm_metadata_body import UpdateVMMetadataBody
from src.cudo_compute.models.update_vm_metadata_response import UpdateVMMetadataResponse
from src.cudo_compute.models.user_permission import UserPermission
from src.cudo_compute.models.v1_private_image import V1PrivateImage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re # noqa: F401

Expand All @@ -19,7 +18,7 @@
from src.cudo_compute.configuration import Configuration


class Body9(object):
class ActivateBody(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Expand All @@ -41,7 +40,7 @@ class Body9(object):
}

def __init__(self, data_center_id=None, _configuration=None): # noqa: E501
"""Body9 - a model defined in Swagger""" # noqa: E501
"""ActivateBody - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
Expand All @@ -54,20 +53,20 @@ def __init__(self, data_center_id=None, _configuration=None): # noqa: E501

@property
def data_center_id(self):
"""Gets the data_center_id of this Body9. # noqa: E501
"""Gets the data_center_id of this ActivateBody. # noqa: E501
:return: The data_center_id of this Body9. # noqa: E501
:return: The data_center_id of this ActivateBody. # 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 Body9.
"""Sets the data_center_id of this ActivateBody.
:param data_center_id: The data_center_id of this Body9. # noqa: E501
:param data_center_id: The data_center_id of this ActivateBody. # noqa: E501
:type: str
"""

Expand All @@ -94,7 +93,7 @@ def to_dict(self):
))
else:
result[attr] = value
if issubclass(Body9, dict):
if issubclass(ActivateBody, dict):
for key, value in self.items():
result[key] = value

Expand All @@ -110,14 +109,14 @@ def __repr__(self):

def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, Body9):
if not isinstance(other, ActivateBody):
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):
if not isinstance(other, ActivateBody):
return True

return self.to_dict() != other.to_dict()
Loading

0 comments on commit e620a46

Please sign in to comment.