Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/dns_data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,15 @@ configuration.portal_key = os.getenv("INFOBLOX_PORTAL_KEY")
with dns_data.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = dns_data.RecordApi(api_client)
body = dns_data.Record() # Record |
inherit = 'inherit_example' # str | This parameter is used for getting inheritance_sources. (optional)
body = dns_data.ConfigureRecordProtectionRequest() # ConfigureRecordProtectionRequest |

try:
# Create the DNS resource record.
api_response = api_instance.create(body, inherit=inherit)
print("The response of RecordApi->create:\n")
# Configure record protection for multiple records in a zone.
api_response = api_instance.configure_record_protection(body)
print("The response of RecordApi->configure_record_protection:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling RecordApi->create: %s\n" % e)
print("Exception when calling RecordApi->configure_record_protection: %s\n" % e)

```

Expand All @@ -69,6 +68,7 @@ All URIs are relative to *http://csp.infoblox.com/api/ddi/v1*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*RecordApi* | [**configure_record_protection**](dns_data/docs/RecordApi.md#configure_record_protection) | **POST** /dns/configure_record_protection | Configure record protection for multiple records in a zone.
*RecordApi* | [**create**](dns_data/docs/RecordApi.md#create) | **POST** /dns/record | Create the DNS resource record.
*RecordApi* | [**delete**](dns_data/docs/RecordApi.md#delete) | **DELETE** /dns/record/{id} | Move the DNS resource record to recycle bin.
*RecordApi* | [**list**](dns_data/docs/RecordApi.md#list) | **GET** /dns/record | Retrieve DNS resource records.
Expand All @@ -79,9 +79,13 @@ Class | Method | HTTP request | Description

## Documentation For Models

- [ConfigureRecordProtectionRequest](dns_data/docs/ConfigureRecordProtectionRequest.md)
- [ConfigureRecordProtectionResponse](dns_data/docs/ConfigureRecordProtectionResponse.md)
- [CreateRecordResponse](dns_data/docs/CreateRecordResponse.md)
- [Inheritance2InheritedUInt32](dns_data/docs/Inheritance2InheritedUInt32.md)
- [ListRecordResponse](dns_data/docs/ListRecordResponse.md)
- [ProtectedRecordItem](dns_data/docs/ProtectedRecordItem.md)
- [Protection](dns_data/docs/Protection.md)
- [ProtobufFieldMask](dns_data/docs/ProtobufFieldMask.md)
- [ReadRecordResponse](dns_data/docs/ReadRecordResponse.md)
- [Record](dns_data/docs/Record.md)
Expand Down
4 changes: 4 additions & 0 deletions src/dns_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@
from dns_data.api.record_api import RecordApi

# import models into sdk package
from dns_data.models.configure_record_protection_request import ConfigureRecordProtectionRequest
from dns_data.models.configure_record_protection_response import ConfigureRecordProtectionResponse
from dns_data.models.create_record_response import CreateRecordResponse
from dns_data.models.inheritance2_inherited_u_int32 import Inheritance2InheritedUInt32
from dns_data.models.list_record_response import ListRecordResponse
from dns_data.models.protected_record_item import ProtectedRecordItem
from dns_data.models.protection import Protection
from dns_data.models.protobuf_field_mask import ProtobufFieldMask
from dns_data.models.read_record_response import ReadRecordResponse
from dns_data.models.record import Record
Expand Down
243 changes: 243 additions & 0 deletions src/dns_data/api/record_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
from pydantic import Field, StrictInt, StrictStr
from typing import Optional
from typing_extensions import Annotated
from dns_data.models.configure_record_protection_request import ConfigureRecordProtectionRequest
from dns_data.models.configure_record_protection_response import ConfigureRecordProtectionResponse
from dns_data.models.create_record_response import CreateRecordResponse
from dns_data.models.list_record_response import ListRecordResponse
from dns_data.models.read_record_response import ReadRecordResponse
Expand All @@ -45,6 +47,247 @@ def __init__(self, api_client=None) -> None:
api_client = ApiClient.get_default()
self.api_client = api_client

@validate_call
def configure_record_protection(
self,
body: ConfigureRecordProtectionRequest,
_request_timeout: Union[None, Annotated[StrictFloat,
Field(gt=0)],
Tuple[Annotated[StrictFloat,
Field(gt=0)],
Annotated[StrictFloat,
Field(gt=0)]]] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ConfigureRecordProtectionResponse:
"""Configure record protection for multiple records in a zone.

Use this method to configure protection levels for DNS records in a zone. This allows setting protection levels (e.g., Global Admin, DDI Admin, None) for multiple records with same rname.

:param body: (required)
:type body: ConfigureRecordProtectionRequest
: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.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._configure_record_protection_serialize(
body=body,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index)

_response_types_map: Dict[str, Optional[str]] = {
'200': "ConfigureRecordProtectionResponse",
}
response_data = self.api_client.call_api(
*_param, _request_timeout=_request_timeout)
response_data.read()
return self.api_client.response_deserialize(
models=models,
response_data=response_data,
response_types_map=_response_types_map,
).data

@validate_call
def configure_record_protection_with_http_info(
self,
body: ConfigureRecordProtectionRequest,
_request_timeout: Union[None, Annotated[StrictFloat,
Field(gt=0)],
Tuple[Annotated[StrictFloat,
Field(gt=0)],
Annotated[StrictFloat,
Field(gt=0)]]] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[ConfigureRecordProtectionResponse]:
"""Configure record protection for multiple records in a zone.

Use this method to configure protection levels for DNS records in a zone. This allows setting protection levels (e.g., Global Admin, DDI Admin, None) for multiple records with same rname.

:param body: (required)
:type body: ConfigureRecordProtectionRequest
: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.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._configure_record_protection_serialize(
body=body,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index)

_response_types_map: Dict[str, Optional[str]] = {
'200': "ConfigureRecordProtectionResponse",
}
response_data = self.api_client.call_api(
*_param, _request_timeout=_request_timeout)
response_data.read()
return self.api_client.response_deserialize(
models=models,
response_data=response_data,
response_types_map=_response_types_map,
)

@validate_call
def configure_record_protection_without_preload_content(
self,
body: ConfigureRecordProtectionRequest,
_request_timeout: Union[None, Annotated[StrictFloat,
Field(gt=0)],
Tuple[Annotated[StrictFloat,
Field(gt=0)],
Annotated[StrictFloat,
Field(gt=0)]]] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Configure record protection for multiple records in a zone.

Use this method to configure protection levels for DNS records in a zone. This allows setting protection levels (e.g., Global Admin, DDI Admin, None) for multiple records with same rname.

:param body: (required)
:type body: ConfigureRecordProtectionRequest
: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.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._configure_record_protection_serialize(
body=body,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index)

_response_types_map: Dict[str, Optional[str]] = {
'200': "ConfigureRecordProtectionResponse",
}
response_data = self.api_client.call_api(
*_param, _request_timeout=_request_timeout)
return response_data.response

def _configure_record_protection_serialize(
self,
body,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:

_host = None

_collection_formats: Dict[str, str] = {}

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[str, Union[str, bytes]] = {}
_body_params: Optional[bytes] = None

# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
if body is not None:
_body_params = body

# set the HTTP header `Accept`
_header_params['Accept'] = self.api_client.select_header_accept(
['application/json'])

# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
['application/json']))
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type

# authentication setting
_auth_settings: List[str] = ['ApiKeyAuth']

return self.api_client.param_serialize(
method='POST',
base_path='/api/ddi/v1',
resource_path='/dns/configure_record_protection',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth)

@validate_call
def create(
self,
Expand Down
31 changes: 31 additions & 0 deletions src/dns_data/docs/ConfigureRecordProtectionRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ConfigureRecordProtectionRequest

The request format to configure record protection for multiple records in a zone.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**protected_records** | [**List[ProtectedRecordItem]**](ProtectedRecordItem.md) | List of records with their protection levels. | [optional]
**zone_id** | **str** | The resource identifier. | [optional]

## Example

```python
from dns_data.models.configure_record_protection_request import ConfigureRecordProtectionRequest

# TODO update the JSON string below
json = "{}"
# create an instance of ConfigureRecordProtectionRequest from a JSON string
configure_record_protection_request_instance = ConfigureRecordProtectionRequest.from_json(json)
# print the JSON string representation of the object
print(ConfigureRecordProtectionRequest.to_json())

# convert the object into a dict
configure_record_protection_request_dict = configure_record_protection_request_instance.to_dict()
# create an instance of ConfigureRecordProtectionRequest from a dict
configure_record_protection_request_from_dict = ConfigureRecordProtectionRequest.from_dict(configure_record_protection_request_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


31 changes: 31 additions & 0 deletions src/dns_data/docs/ConfigureRecordProtectionResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ConfigureRecordProtectionResponse

The response format for configuring record protection.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**protected_records** | [**List[ProtectedRecordItem]**](ProtectedRecordItem.md) | List of records with their protection levels and protection status. | [optional]
**zone_id** | **str** | The resource identifier. | [optional]

## Example

```python
from dns_data.models.configure_record_protection_response import ConfigureRecordProtectionResponse

# TODO update the JSON string below
json = "{}"
# create an instance of ConfigureRecordProtectionResponse from a JSON string
configure_record_protection_response_instance = ConfigureRecordProtectionResponse.from_json(json)
# print the JSON string representation of the object
print(ConfigureRecordProtectionResponse.to_json())

# convert the object into a dict
configure_record_protection_response_dict = configure_record_protection_response_instance.to_dict()
# create an instance of ConfigureRecordProtectionResponse from a dict
configure_record_protection_response_from_dict = ConfigureRecordProtectionResponse.from_dict(configure_record_protection_response_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Loading
Loading