Skip to content

Commit a4bc066

Browse files
authored
feat: domain registration API and wait_for_domain_order (#3)
Refresh api/openapi.json from the API description with the registrar services (/v1/registrar/...) and regenerate. Add wait_for_domain_order (sync and async), which polls a domain order until it is final. Signed-off-by: Shaygun <17057583+shaygun@users.noreply.github.com>
1 parent eecfe2b commit a4bc066

10 files changed

Lines changed: 37661 additions & 25736 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ All notable changes are documented here. The format follows
66

77
## [Unreleased]
88

9+
### Added
10+
11+
- Domain registration: the `domain_search`, `domain_order`, `registered_domain` and
12+
`domain_contact` services (`/v1/registrar/...`), regenerated from the API description. Domain
13+
orders are paid by card only; checkout needs `accept_terms_version` and `mit_consent`.
14+
- `wait_for_domain_order` (sync and async) waits until a domain order is final.
15+
916
## [0.1.0]
1017

1118
### Added

‎README.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
The official Python SDK for the [NodeRings](https://noderings.com) API. It covers the whole
1111
public API: virtual machines, DNS, firewalls, snapshots and backups, game servers, IP address
1212
management, the marketplace, billing, access control, support tickets, and the provider side for
13-
hosts who sell on NodeRings. That is 485 operations in 69 services, all typed, with a sync and an
13+
hosts who sell on NodeRings. That is 545 operations in 75 services, all typed, with a sync and an
1414
asyncio client.
1515

1616
```sh
@@ -141,13 +141,15 @@ retry a create safely after your program restarts.
141141

142142
**Waiting.** `wait_for_virtual_machine_status`, `wait_for_virtual_machine_deleted` and the
143143
general `wait_for_virtual_machine(id, until=...)` poll until a condition holds, with `interval`
144-
and `timeout` in seconds. They raise `WaitTimeoutError` with the last state read.
144+
and `timeout` in seconds. `wait_for_domain_order(order_id)` polls a domain order (after
145+
`domain_order.checkout_domain_order`) until it is completed, partially completed, failed, canceled
146+
or expired. They raise `WaitTimeoutError` with the last state read.
145147

146148
## Testing
147149

148150
| Suite | What it checks |
149151
|---|---|
150-
| `pytest` | Calls every one of the 485 generated methods, sync and async, against a fake API and checks the HTTP method, the path and its escaping, every query parameter's name, every body field's name and the auth headers against the API description. Also covers retries, `Retry-After`, errors, idempotency keys, paging, waiting, nulls, unknown enum values, and 64-bit and bytes encoding. |
152+
| `pytest` | Calls every one of the 545 generated methods, sync and async, against a fake API and checks the HTTP method, the path and its escaping, every query parameter's name, every body field's name and the auth headers against the API description. Also covers retries, `Retry-After`, errors, idempotency keys, paging, waiting, nulls, unknown enum values, and 64-bit and bytes encoding. |
151153
| `pytest -m live` | Against the real API: every read that needs no ID, checked for fields the description lacks; SSH keys, a DNS zone with records, firewall rulesets and rules, and cloud-init data created and deleted; async reads. With `NODERINGS_TEST_BILLED=1`, a virtual machine is created, started, stopped, started, restarted, tagged, snapshotted, given a firewall and deleted. |
152154

153155
The live suite runs nightly in CI. See [CONTRIBUTING.md](CONTRIBUTING.md).

0 commit comments

Comments
 (0)