diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..896e5d4 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,3 @@ +[env] +RUST_TEST_THREADS = "1" +# RUST_BACKTRACE = "1" \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e747f0a..0ff21ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,11 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - name: Checkout code + uses: actions/checkout@v5 + - name: Build run: cargo build --verbose + - name: Run tests run: cargo test --verbose -- --test-threads=1 diff --git a/.github/workflows/update-openapi-docs.yml b/.github/workflows/update-openapi-docs.yml new file mode 100644 index 0000000..63c4a54 --- /dev/null +++ b/.github/workflows/update-openapi-docs.yml @@ -0,0 +1,46 @@ +name: Update OpenAPI Docs + +on: + push: + branches: [ "main", "develop" ] + paths: + - "docs/openapi.yaml" + workflow_dispatch: + +jobs: + build-docs: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Setup Node + uses: actions/setup-node@v6 + with: + node-version: "24" + + - name: Install Redocly CLI + run: npm install -g @redocly/cli + + - name: Build OpenAPI docs + working-directory: docs + run: | + npx @redocly/cli build-docs openapi.yaml -o index.html + + - name: Commit & Push updated docs (only on push, not PR) + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + + git add docs/index.html + + # Only commit and push if there are changes + if ! git diff --cached --quiet; then + git commit -m "chore: update openapi docs" + git push origin ${GITHUB_REF#refs/heads/} + else + echo "No changes to commit." + fi diff --git a/docs/index.html b/docs/index.html index 278f8a7..64b306d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -94,6 +94,16 @@ .icJLQx .sc-jaXbil,.icJLQx .sc-jaXbil .sc-jaXbil .sc-jaXbil,.icJLQx .sc-jaXbil .sc-jaXbil .sc-jaXbil .sc-jaXbil .sc-jaXbil{margin:1em;margin-right:0;background:#fafafa;}/*!sc*/ .icJLQx .sc-jaXbil .sc-jaXbil,.icJLQx .sc-jaXbil .sc-jaXbil .sc-jaXbil .sc-jaXbil,.icJLQx .sc-jaXbil .sc-jaXbil .sc-jaXbil .sc-jaXbil .sc-jaXbil .sc-jaXbil{background:#ffffff;}/*!sc*/ data-styled.g24[id="sc-eqNDNG"]{content:"icJLQx,"}/*!sc*/ +.lgjAct{margin:0 0 3px 0;display:inline-block;}/*!sc*/ +data-styled.g25[id="sc-fVHBlr"]{content:"lgjAct,"}/*!sc*/ +.cSpDZT{font-size:0.9em;margin-right:10px;color:#32329f;font-family:Montserrat,sans-serif;}/*!sc*/ +data-styled.g26[id="sc-gLaqbQ"]{content:"cSpDZT,"}/*!sc*/ +.kgojdz{display:inline-block;margin-right:10px;margin-bottom:5px;font-size:0.8em;cursor:pointer;border:1px solid #32329f;padding:2px 10px;line-height:1.5em;outline:none;color:white;background-color:#32329f;}/*!sc*/ +.kgojdz:focus{box-shadow:0 0 0 1px #32329f;}/*!sc*/ +.kgojdz:focus{box-shadow:none;background-color:#202065;}/*!sc*/ +.gdJbxD{display:inline-block;margin-right:10px;margin-bottom:5px;font-size:0.8em;cursor:pointer;border:1px solid #32329f;padding:2px 10px;line-height:1.5em;outline:none;color:#32329f;background-color:white;}/*!sc*/ +.gdJbxD:focus{box-shadow:0 0 0 1px #32329f;}/*!sc*/ +data-styled.g27[id="sc-ipUnzB"]{content:"kgojdz,gdJbxD,"}/*!sc*/ .fyxuKi >ul{list-style:none;padding:0;margin:0;margin:0 -5px;}/*!sc*/ .fyxuKi >ul >li{padding:5px 10px;display:inline-block;background-color:#11171a;border-bottom:1px solid rgba(0, 0, 0, 0.5);cursor:pointer;text-align:center;outline:none;color:#ccc;margin:0 5px 5px 5px;border:1px solid #07090b;border-radius:5px;min-width:60px;font-size:0.9em;font-weight:bold;}/*!sc*/ .fyxuKi >ul >li.react-tabs__tab--selected{color:#333333;background:#ffffff;}/*!sc*/ @@ -418,15 +428,15 @@ " class="sc-eVqvcJ sc-fszimp sc-etsjJW kIppRw jnwENr ljKHqG">

A list of DNS zones

Response samples

Content type
application/json
{
  • "zones": [
    ]
}

Create a new DNS zone

Response samples

Content type
application/json
{
  • "zones": [
    ]
}

Create a new DNS zone

Creates a new DNS zone with the specified details.

-
Authorizations:
bearerAuth
Request Body schema: application/json
required
name
required
string
primary_ns
required
string
primary_ns_ip
required
string <ipv4>
admin_email
required
string <email>
ttl
required
integer <int32>
serial
required
integer <int32>
refresh
integer <int32>
retry
integer <int32>
expire
integer <int32>
minimum_ttl
integer <int32>

Responses

name
required
string
primary_ns
required
string
primary_ns_ip
required
string <ipv4>
primary_ns_ipv6
string <ipv6>
admin_email
required
string <email>
ttl
required
integer <int32>
serial
required
integer <int32>
refresh
integer <int32>
retry
integer <int32>
expire
integer <int32>
minimum_ttl
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "name": "example.com",
  • "primary_ns": "ns1.example.com",
  • "primary_ns_ip": "127.0.0.1",
  • "admin_email": "admin@example.com",
  • "ttl": 3600,
  • "serial": 2025100101,
  • "refresh": 7200,
  • "retry": 3600,
  • "expire": 604800,
  • "minimum_ttl": 3600
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "example.com",
  • "primary_ns": "ns1.example.com",
  • "primary_ns_ip": "127.0.0.1",
  • "admin_email": "admin@example.com",
  • "ttl": 3600,
  • "serial": 2025100101,
  • "refresh": 7200,
  • "retry": 3600,
  • "expire": 604800,
  • "minimum_ttl": 3600
}

Get a specific DNS zone

Request samples

Content type
application/json
{
  • "name": "example.com",
  • "primary_ns": "ns1.example.com",
  • "primary_ns_ip": "127.0.0.1",
  • "primary_ns_ipv6": "::1",
  • "admin_email": "admin@example.com",
  • "ttl": 3600,
  • "serial": 2025100101,
  • "refresh": 7200,
  • "retry": 3600,
  • "expire": 604800,
  • "minimum_ttl": 3600
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "example.com",
  • "primary_ns": "ns1.example.com",
  • "primary_ns_ip": "127.0.0.1",
  • "primary_ns_ipv6": "::1",
  • "admin_email": "admin@example.com",
  • "ttl": 3600,
  • "serial": 2025100101,
  • "refresh": 7200,
  • "retry": 3600,
  • "expire": 604800,
  • "minimum_ttl": 3600
}

Get a specific DNS zone

Retrieves details of a specific DNS zone by its ID.

Authorizations:
bearerAuth
path Parameters
zone_id
required
integer <int32>

The ID of the DNS zone to retrieve.

@@ -436,17 +446,17 @@ " class="sc-eVqvcJ sc-fszimp sc-etsjJW kIppRw jnwENr ljKHqG">

Details of the DNS zone

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "example.com",
  • "primary_ns": "ns1.example.com",
  • "primary_ns_ip": "127.0.0.1",
  • "admin_email": "admin@example.com",
  • "ttl": 3600,
  • "serial": 2025100101,
  • "refresh": 7200,
  • "retry": 3600,
  • "expire": 604800,
  • "minimum_ttl": 3600
}

Update a specific DNS zone

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "example.com",
  • "primary_ns": "ns1.example.com",
  • "primary_ns_ip": "127.0.0.1",
  • "primary_ns_ipv6": "::1",
  • "admin_email": "admin@example.com",
  • "ttl": 3600,
  • "serial": 2025100101,
  • "refresh": 7200,
  • "retry": 3600,
  • "expire": 604800,
  • "minimum_ttl": 3600
}

Update a specific DNS zone

Updates the details of a specific DNS zone.

Authorizations:
bearerAuth
path Parameters
zone_id
required
integer <int32>

The ID of the DNS zone to update.

-
Request Body schema: application/json
required
name
required
string
primary_ns
required
string
primary_ns_ip
required
string <ipv4>
admin_email
required
string <email>
ttl
required
integer <int32>
serial
required
integer <int32>
refresh
integer <int32>
retry
integer <int32>
expire
integer <int32>
minimum_ttl
integer <int32>

Responses

name
required
string
primary_ns
required
string
primary_ns_ip
required
string <ipv4>
primary_ns_ipv6
string <ipv6>
admin_email
required
string <email>
ttl
required
integer <int32>
serial
required
integer <int32>
refresh
integer <int32>
retry
integer <int32>
expire
integer <int32>
minimum_ttl
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "name": "example.com",
  • "primary_ns": "ns1.example.com",
  • "primary_ns_ip": "127.0.0.1",
  • "admin_email": "admin@example.com",
  • "ttl": 3600,
  • "serial": 2025100101,
  • "refresh": 7200,
  • "retry": 3600,
  • "expire": 604800,
  • "minimum_ttl": 3600
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "example.com",
  • "primary_ns": "ns1.example.com",
  • "primary_ns_ip": "127.0.0.1",
  • "admin_email": "admin@example.com",
  • "ttl": 3600,
  • "serial": 2025100101,
  • "refresh": 7200,
  • "retry": 3600,
  • "expire": 604800,
  • "minimum_ttl": 3600
}

Delete a specific DNS zone

Request samples

Content type
application/json
{
  • "name": "example.com",
  • "primary_ns": "ns1.example.com",
  • "primary_ns_ip": "127.0.0.1",
  • "primary_ns_ipv6": "::1",
  • "admin_email": "admin@example.com",
  • "ttl": 3600,
  • "serial": 2025100101,
  • "refresh": 7200,
  • "retry": 3600,
  • "expire": 604800,
  • "minimum_ttl": 3600
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "example.com",
  • "primary_ns": "ns1.example.com",
  • "primary_ns_ip": "127.0.0.1",
  • "primary_ns_ipv6": "::1",
  • "admin_email": "admin@example.com",
  • "ttl": 3600,
  • "serial": 2025100101,
  • "refresh": 7200,
  • "retry": 3600,
  • "expire": 604800,
  • "minimum_ttl": 3600
}

Delete a specific DNS zone

Deletes a specific DNS zone by its ID.

Authorizations:
bearerAuth
path Parameters
zone_id
required
integer <int32>

The ID of the DNS zone to delete.

@@ -574,7 +584,7 @@ " class="sc-eVqvcJ sc-fszimp sc-etsjJW kIppRw jnwENr ljKHqG">

Internal server error

Response samples

Content type
application/json
{
  • "msg": "DNS configuration written successfully"
}