You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+157-8Lines changed: 157 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,16 @@
38
38
-[Add a new SSH key](#add-a-new-ssh-key)
39
39
-[Update an SSH key](#update-an-ssh-key)
40
40
-[Delete an SSH key](#delete-an-ssh-key)
41
-
-[Domains](#domains)
41
+
-[Domain](#domain)
42
+
-[Domains](#domains)
43
+
- [The **Domain** class](#the-domain-class)
44
+
- [List all domains](#list-all-domains)
45
+
- [Retrieve an existing domain](#retrieve-an-existing-domain)
46
+
-[DNS](#dns)
47
+
-[The **DnsEntry** class](#the-dnsentry-class)
48
+
-[List all DNS entries for a domain](#list-all-dns-entries-for-a-domain)
49
+
-[Add a new single DNS entry to a domain](#add-a-new-single-dns-entry-to-a-domain)
50
+
-[Remove a DNS entry from a domain](#remove-a-dns-entry-from-a-domain)
42
51
-[VPS](#vps)
43
52
-[HA-IP](#ha-ip)
44
53
-[Colocation](#colocation)
@@ -102,7 +111,7 @@ The [general TransIP API](https://api.transip.nl/rest/docs.html#general) resourc
102
111
### Products
103
112
Manage available TransIP products and product specifications.
104
113
105
-
### The **Product** class
114
+
####The **Product** class
106
115
When listing all products available on TransIP, a list of **transip.v6.objects.Product** objects is returned.
107
116
108
117
**_class_ Product**
@@ -115,7 +124,7 @@ The **Product** class makes the following attributes available:
115
124
-**recurringPrice**: The recurring price for the product in cents.
116
125
-**elements**: The service to list detailed information on the product elements.
117
126
118
-
### The **ProductElement** class
127
+
####The **ProductElement** class
119
128
When listing all product elements of a **transip.v6.objects.Product** object, a list of **transip.v6.objects.ProductElement** objects is returned.
120
129
121
130
**_class_ ProductElement**
@@ -165,7 +174,7 @@ for product in client.products.list():
165
174
### Availability Zones
166
175
Manage TransIP availability zones.
167
176
168
-
### The **AvailabilityZone** class
177
+
####The **AvailabilityZone** class
169
178
When listing all the available availability zones on TransIP, a list of **transip.v6.objects.AvailabilityZone** objects is returned.
170
179
171
180
**_class_ AvailabilityZone**
@@ -212,7 +221,7 @@ The [account TransIP API](https://api.transip.nl/rest/docs.html#account) resourc
212
221
### Invoices
213
222
Manage invoices attached to your TransIP account.
214
223
215
-
### The **Invoice** class
224
+
####The **Invoice** class
216
225
When listing all invoices attached to your TransIP account, a list of **transip.v6.objects.Invoice** objects is returned.
217
226
218
227
**_class_ Invoice**
@@ -230,7 +239,7 @@ The **Invoice** class makes the following attributes available:
230
239
-**items**: The service to list detailed information on the individual invoice items.
231
240
232
241
233
-
### The **InvoiceItem** class
242
+
####The **InvoiceItem** class
234
243
When listing all invoices items attached to a **transip.v6.objects.Invoice** object, a list of **transip.v6.objects.InvoiceItem** objects is returned.
235
244
236
245
**_class_ InvoiceItem**
@@ -437,8 +446,148 @@ The **transip.v6.objects.SshKey** class also provides a **delete()** method to d
437
446
438
447
**Note:** when using the demo access token, the API currently doesn't list any SSH keys.
439
448
440
-
## Domains
441
-
The documentation for managing **domains** and related resources has not yet been documented. Feel free to file an [issue](https://github.com/roaldnefs/python-transip/issues/new/choose) for adding the missing section(s) in the documentation.
449
+
## Domain
450
+
The [domains TransIP API](https://api.transip.nl/rest/docs.html#general) resources allow you to manage domains, branding, contacts, DNS, DNSSEC, nameservers, actions, SSL, WHOIS, availability and call the tlds resource.
451
+
452
+
The documentation for managing **domains** and related resources has not yet completely been documented. Feel free to file an [issue](https://github.com/roaldnefs/python-transip/issues/new/choose) for adding the missing section(s) in the documentation.
453
+
454
+
### Domains
455
+
Manage domains.
456
+
457
+
#### The **Domain** class
458
+
When listing all domains in your TransIP account, a list of **transip.v6.objects.Domain** objects is returned.
459
+
460
+
**_class_ Domain**
461
+
462
+
The **Domain** class makes the following attributes available:
463
+
464
+
-**name**: The name, including the tld of this domain.
465
+
-**authCode**: The authcode for this domain as generated by the registry.
466
+
-**isTransferLocked**: If this domain supports transfer locking, this flag is True when the domains ability to transfer is locked at the registry.
467
+
-**registrationDate**: The registration date of the domain, in YYYY-mm-dd format.
468
+
-**renewalDate**: The next renewal date of the domain, in YYYY-mm-dd format.
469
+
-**isWhitelabel**: If this domain is added to your whitelabel.
470
+
-**cancellationDate**: Cancellation data, in YYYY-mm-dd h:i:s format, None if the domain is active.
471
+
-**cancellationStatus**: Cancellation status, None if the domain is active, ‘cancelled’ when the domain is cancelled.
472
+
-**isDnsOnly**: Whether this domain is DNS only.
473
+
-**tags**: The custom tags added to this domain.
474
+
-**contacts**: The service to manage the domain contacts.
475
+
-**dns**: The service to manage the DNS-records of the domain.
476
+
-**nameservers**: The service to manage the nameservers of the domain.
477
+
478
+
#### List all domains
479
+
Retrieve all domains registered in your TransIP account by calling **transip.TransIP.domains.list()**. This will return a list of **transip.v6.objects.Domain** objects.
480
+
481
+
For example:
482
+
```python
483
+
import transip
484
+
# Initialize a client using the TransIP demo token.
print(f"Domain {domain.name} was registered at {domain.registrationDate}")
492
+
```
493
+
494
+
#### Retrieve an existing domain
495
+
Retrieve a single domain registered ion your TransIP account by its ID by calling **transip.TransIP.domains.get(_name_)**. This will return a **transip.v6.objects.Domain** object.
496
+
497
+
For example:
498
+
```python
499
+
import transip
500
+
# Initialize a client using the TransIP demo token.
print(f"Domain {domain.name} was registered at {domain.registrationDate}")
507
+
```
508
+
509
+
### DNS
510
+
Manage DNS records of a domain. Any changes made here will be pushed to the TransIP nameservers.
511
+
#### The **DnsEntry** class
512
+
513
+
When listing all DNS-records of a **transip.v6.objects.Domain** object, a list of **transip.v6.objects.DnsEntry** objects is returned.
514
+
515
+
**_class_ DnsEntry**
516
+
517
+
The **DnsEntry** class makes the following attributes available:
518
+
519
+
-**name**: The name of the dns entry, for example ‘@’ or ‘www’
520
+
-**expire**: The expiration period of the dns entry, in seconds. For example 86400 for a day of expiration.
521
+
-**type**: The type of dns entry. Possbible types are ‘A’, ‘AAAA’, ‘CNAME’, ‘MX’, ‘NS’, ‘TXT’, ‘SRV’, ‘SSHFP’ and ‘TLSA’.
522
+
-**content**: The content of of the dns entry, for example ‘10 mail’, ‘127.0.0.1’ or ‘www’.
523
+
524
+
The class has the following methods:
525
+
526
+
-**delete()** will delete the DNS-record from the domain.
527
+
528
+
#### List all DNS entries for a domain
529
+
Retrieve the DNS records of a single domain registered in your TransIP account by calling **dns.list()** on a **transip.v6.objects.Domain** object. This will return a list of **transip.v6.objects.DnsEntry** objects.
530
+
531
+
For example:
532
+
```python
533
+
import transip
534
+
# Initialize a client using the TransIP demo token.
Add an new DNS record to a domain by calling **dns.create(_data_)** on a **transip.v6.objects.Domain** object. The **data** keyword argument a dictionary containing the **name**, **expire**, **type** and **content** attributes.
548
+
549
+
For example:
550
+
```python
551
+
import transip
552
+
# Initialize a client using the TransIP demo token.
# Dictionary containing the information for a single DNS record.
558
+
dns_entry_data = {
559
+
"name": "www",
560
+
"expire": 86400,
561
+
"type": "A",
562
+
"content": "127.0.0.1"
563
+
}
564
+
# Add the DNS record to the domain.
565
+
domain.delete(dns_entry_data)
566
+
```
567
+
568
+
#### Remove a DNS entry from a domain
569
+
Delete an existing DNS record from a domain by calling **dns.delete(_data_)** on a **transip.v6.objects.Domain** object. The **data** keyword argument a dictionary containing the **name**, **expire**, **type** and **content** attributes.
570
+
571
+
For example:
572
+
```python
573
+
import transip
574
+
# Initialize a client using the TransIP demo token.
# Dictionary containing the information for a single DNS record.
580
+
dns_entry_data = {
581
+
"name": "www",
582
+
"expire": 86400,
583
+
"type": "A",
584
+
"content": "127.0.0.1"
585
+
}
586
+
# Delete the DNS record from the domain.
587
+
domain.delete(dns_entry_data)
588
+
```
589
+
590
+
The **transip.v6.objects.DnsEntry** class also provides a **delete()** method to delete a **DnsEntry** object from an instance.
442
591
443
592
## VPS
444
593
The documentation for managing **VPSs** and related resources has not yet been documented. Feel free to file an [issue](https://github.com/roaldnefs/python-transip/issues/new/choose) for adding the missing section(s) in the documentation.
0 commit comments