Class Changes (0.31.0)

Changes(zone)

Changes are bundled additions / deletions of DNS resource records.

Changes are owned by a xref_ManagedZone instance.

See https://cloud.google.com/dns/api/v1/changes

Parameter

NameDescription
zone ManagedZone

A zone which holds one or more record sets.

Properties

additions

Resource record sets to be added to the zone.

Returns
TypeDescription
sequence of ResourceRecordSet.record sets appended via add_record_set.

deletions

Resource record sets to be deleted from the zone.

Returns
TypeDescription
sequence of ResourceRecordSet.record sets appended via delete_record_set.

name

Name of the change set.

Returns
TypeDescription
str or NoneTypeName, as set by the back-end, or None.

path

URL path for change set APIs.

Returns
TypeDescription
strthe path based on project, zone, and change set names.

started

Time when the change set was started.

Returns
TypeDescription
datetime.datetime or NoneTypeTime, as set by the back-end, or None.

status

Status of the change set.

Returns
TypeDescription
str or NoneTypeStatus, as set by the back-end, or None.

Methods

add_record_set

add_record_set(record_set)

Append a record set to the 'additions' for the change set.

Parameter
NameDescription
record_set ResourceRecordSet

the record set to append.

Exceptions
TypeDescription
`ValueErrorif record_set is not of the required type.

create

create(client=None)

API call: create the change set via a POST request.

See https://cloud.google.com/dns/api/v1/changes/create

Parameter
NameDescription
client Client

(Optional) the client to use. If not passed, falls back to the client stored on the current zone.

delete_record_set

delete_record_set(record_set)

Append a record set to the 'deletions' for the change set.

Parameter
NameDescription
record_set ResourceRecordSet

the record set to append.

Exceptions
TypeDescription
`ValueErrorif record_set is not of the required type.

exists

exists(client=None)

API call: test for the existence of the change set via a GET request.

See https://cloud.google.com/dns/api/v1/changes/get

Parameter
NameDescription
client Client

(Optional) the client to use. If not passed, falls back to the client stored on the current zone.

Returns
TypeDescription
boolBoolean indicating existence of the changes.

from_api_repr

from_api_repr(resource, zone)

Factory: construct a change set given its API representation

Parameters
NameDescription
resource dict

change set representation returned from the API.

zone ManagedZone

A zone which holds zero or more change sets.

Returns
TypeDescription
ChangesRRS parsed from resource.

reload

reload(client=None)

API call: refresh zone properties via a GET request.

See https://cloud.google.com/dns/api/v1/changes/get

Parameter
NameDescription
client Client

(Optional) the client to use. If not passed, falls back to the client stored on the current zone.