Skip to content

Commit

Permalink
feat(InstancesAPI): Add search parameter (#231)
Browse files Browse the repository at this point in the history
Co-authored-by: Philipp Fruck <[email protected]>
  • Loading branch information
github-actions[bot] and p-fruck authored May 19, 2024
1 parent 91a5c3c commit 8431f01
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
6 changes: 4 additions & 2 deletions docs/InstancesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ Name | Type | Description | Notes
[[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)

# **retrieve_instances_list**
> ListInstancesResponse retrieve_instances_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, display_name=display_name, data_center=data_center, region=region, instance_id=instance_id, instance_ids=instance_ids, status=status, add_on_ids=add_on_ids, product_types=product_types, ip_config=ip_config)
> ListInstancesResponse retrieve_instances_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, display_name=display_name, data_center=data_center, region=region, instance_id=instance_id, instance_ids=instance_ids, status=status, add_on_ids=add_on_ids, product_types=product_types, ip_config=ip_config, search=search)
List instances

Expand Down Expand Up @@ -482,10 +482,11 @@ with pfruck_contabo.ApiClient(configuration) as api_client:
add_on_ids = '1044,827' # str | Identifiers of Addons the instances have (optional)
product_types = 'ssd, hdd, nvme' # str | Comma separated instance's category depending on Product Id (optional)
ip_config = true # bool | Filter instances that have an ip config (optional)
search = 'vmd12345' # str | Full text search when listing the instances. Can be searched by `name`, `displayName`, `ipAddress` (optional)

try:
# List instances
api_response = api_instance.retrieve_instances_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, display_name=display_name, data_center=data_center, region=region, instance_id=instance_id, instance_ids=instance_ids, status=status, add_on_ids=add_on_ids, product_types=product_types, ip_config=ip_config)
api_response = api_instance.retrieve_instances_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, display_name=display_name, data_center=data_center, region=region, instance_id=instance_id, instance_ids=instance_ids, status=status, add_on_ids=add_on_ids, product_types=product_types, ip_config=ip_config, search=search)
print("The response of InstancesApi->retrieve_instances_list:\n")
pprint(api_response)
except Exception as e:
Expand Down Expand Up @@ -514,6 +515,7 @@ Name | Type | Description | Notes
**add_on_ids** | **str**| Identifiers of Addons the instances have | [optional]
**product_types** | **str**| Comma separated instance&#39;s category depending on Product Id | [optional]
**ip_config** | **bool**| Filter instances that have an ip config | [optional]
**search** | **str**| Full text search when listing the instances. Can be searched by &#x60;name&#x60;, &#x60;displayName&#x60;, &#x60;ipAddress&#x60; | [optional]

### Return type

Expand Down
2 changes: 1 addition & 1 deletion docs/SnapshotsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ Name | Type | Description | Notes
Revert the instance to a particular snapshot based on its identifier

Rollback instance to a specific snapshot. The snapshot must be the latest one in order to be able to restore it, otherwise you will receive an error informing you that the snapshot is not the latest
Rollback the instance to a specific snapshot. In case the snapshot is not the latest one, it will automatically delete all the newer snapshots of the instance

### Example

Expand Down
17 changes: 17 additions & 0 deletions pfruck_contabo/api/instances_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,7 @@ def retrieve_instances_list(
add_on_ids: Annotated[Optional[StrictStr], Field(description="Identifiers of Addons the instances have")] = None,
product_types: Annotated[Optional[StrictStr], Field(description="Comma separated instance's category depending on Product Id")] = None,
ip_config: Annotated[Optional[StrictBool], Field(description="Filter instances that have an ip config")] = None,
search: Annotated[Optional[StrictStr], Field(description="Full text search when listing the instances. Can be searched by `name`, `displayName`, `ipAddress`")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand Down Expand Up @@ -1622,6 +1623,8 @@ def retrieve_instances_list(
:type product_types: str
:param ip_config: Filter instances that have an ip config
:type ip_config: bool
:param search: Full text search when listing the instances. Can be searched by `name`, `displayName`, `ipAddress`
:type search: str
: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
Expand Down Expand Up @@ -1660,6 +1663,7 @@ def retrieve_instances_list(
add_on_ids=add_on_ids,
product_types=product_types,
ip_config=ip_config,
search=search,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand Down Expand Up @@ -1698,6 +1702,7 @@ def retrieve_instances_list_with_http_info(
add_on_ids: Annotated[Optional[StrictStr], Field(description="Identifiers of Addons the instances have")] = None,
product_types: Annotated[Optional[StrictStr], Field(description="Comma separated instance's category depending on Product Id")] = None,
ip_config: Annotated[Optional[StrictBool], Field(description="Filter instances that have an ip config")] = None,
search: Annotated[Optional[StrictStr], Field(description="Full text search when listing the instances. Can be searched by `name`, `displayName`, `ipAddress`")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand Down Expand Up @@ -1745,6 +1750,8 @@ def retrieve_instances_list_with_http_info(
:type product_types: str
:param ip_config: Filter instances that have an ip config
:type ip_config: bool
:param search: Full text search when listing the instances. Can be searched by `name`, `displayName`, `ipAddress`
:type search: str
: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
Expand Down Expand Up @@ -1783,6 +1790,7 @@ def retrieve_instances_list_with_http_info(
add_on_ids=add_on_ids,
product_types=product_types,
ip_config=ip_config,
search=search,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand Down Expand Up @@ -1821,6 +1829,7 @@ def retrieve_instances_list_without_preload_content(
add_on_ids: Annotated[Optional[StrictStr], Field(description="Identifiers of Addons the instances have")] = None,
product_types: Annotated[Optional[StrictStr], Field(description="Comma separated instance's category depending on Product Id")] = None,
ip_config: Annotated[Optional[StrictBool], Field(description="Filter instances that have an ip config")] = None,
search: Annotated[Optional[StrictStr], Field(description="Full text search when listing the instances. Can be searched by `name`, `displayName`, `ipAddress`")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand Down Expand Up @@ -1868,6 +1877,8 @@ def retrieve_instances_list_without_preload_content(
:type product_types: str
:param ip_config: Filter instances that have an ip config
:type ip_config: bool
:param search: Full text search when listing the instances. Can be searched by `name`, `displayName`, `ipAddress`
:type search: str
: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
Expand Down Expand Up @@ -1906,6 +1917,7 @@ def retrieve_instances_list_without_preload_content(
add_on_ids=add_on_ids,
product_types=product_types,
ip_config=ip_config,
search=search,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand Down Expand Up @@ -1939,6 +1951,7 @@ def _retrieve_instances_list_serialize(
add_on_ids,
product_types,
ip_config,
search,
_request_auth,
_content_type,
_headers,
Expand Down Expand Up @@ -2012,6 +2025,10 @@ def _retrieve_instances_list_serialize(

_query_params.append(('ipConfig', ip_config))

if search is not None:

_query_params.append(('search', search))

# process the header parameters
if x_request_id is not None:
_header_params['x-request-id'] = x_request_id
Expand Down
6 changes: 3 additions & 3 deletions pfruck_contabo/api/snapshots_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ def rollback_snapshot(
) -> RollbackSnapshotResponse:
"""Revert the instance to a particular snapshot based on its identifier
Rollback instance to a specific snapshot. The snapshot must be the latest one in order to be able to restore it, otherwise you will receive an error informing you that the snapshot is not the latest
Rollback the instance to a specific snapshot. In case the snapshot is not the latest one, it will automatically delete all the newer snapshots of the instance
:param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required)
:type x_request_id: str
Expand Down Expand Up @@ -1424,7 +1424,7 @@ def rollback_snapshot_with_http_info(
) -> ApiResponse[RollbackSnapshotResponse]:
"""Revert the instance to a particular snapshot based on its identifier
Rollback instance to a specific snapshot. The snapshot must be the latest one in order to be able to restore it, otherwise you will receive an error informing you that the snapshot is not the latest
Rollback the instance to a specific snapshot. In case the snapshot is not the latest one, it will automatically delete all the newer snapshots of the instance
:param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required)
:type x_request_id: str
Expand Down Expand Up @@ -1507,7 +1507,7 @@ def rollback_snapshot_without_preload_content(
) -> RESTResponseType:
"""Revert the instance to a particular snapshot based on its identifier
Rollback instance to a specific snapshot. The snapshot must be the latest one in order to be able to restore it, otherwise you will receive an error informing you that the snapshot is not the latest
Rollback the instance to a specific snapshot. In case the snapshot is not the latest one, it will automatically delete all the newer snapshots of the instance
:param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required)
:type x_request_id: str
Expand Down

0 comments on commit 8431f01

Please sign in to comment.