Crate aliyun_dns

source ·
Expand description

Aliyun DNS API Client

This crate provides a simple and easy-to-use API client for managing domain records through the Aliyun DNS API.

Overview

The main entry point for interacting with the Aliyun DNS API is the AliyunDns struct. It provides methods for adding, updating, deleting, and querying domain records.

Features

  • Add a new domain record
  • Delete a domain record
  • Delete subdomain records
  • Update a domain record
  • Query domain records

Usage

Add the aliyun_dns crate to your Cargo.toml:

[dependencies]
aliyun_dns = "0.1.0"

Then, in your code, create a new AliyunDns instance with your Aliyun API Access Key ID and Secret, and start using the provided methods.

use aliyun_dns::AliyunDns;

let access_key_id = "your_access_key_id";
let access_key_secret = "your_access_key_secret";
let aliyun_dns = AliyunDns::new(access_key_id.to_string(), access_key_secret.to_string());

// Use the provided methods to interact with the API

Example

This example demonstrates how to query domain records using the AliyunDns API client.

use aliyun_dns::AliyunDns;

#[tokio::main]
async fn main() {
    let access_key_id = "your_access_key_id";
    let access_key_secret = "your_access_key_secret";
    let aliyun_dns = AliyunDns::new(access_key_id.to_string(), access_key_secret.to_string());

    match aliyun_dns.query_domain_records("example.com").await {
        Ok(response) => {
            println!("Total domain records: {}", response.total_count);
            for record in response.domain_records.records {
                println!("Record: {:#?}", record);
            }
        }
        Err(e) => eprintln!("Error: {}", e),
    }
}

For more examples, please refer to the examples directory in the repository.

License

This crate is licensed under the MIT License.

For more information, see the LICENSE file in the repository.

GitHub license

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

Additional Documentation

The full API documentation can be found here.

For more information on the Aliyun DNS API, please refer to the official Aliyun DNS API documentation.

Disclaimer

This crate is not officially affiliated with or endorsed by Alibaba Cloud or Aliyun.

It is a third-party implementation and the maintainers of this crate are not responsible for any issues that may arise from its use.

Please use this crate at your own risk and make sure to comply with Alibaba Cloud’s terms of service.

Changelog

To see the changes made between different versions of this crate, please refer to the CHANGELOG.md file in the repository.

Support

If you encounter any issues or have questions about this crate, please open an issue on the GitHub repository.

  • Aliyun SDK for Rust: Official Alibaba Cloud SDK for the Rust programming language (in development)
  • Aliyun CLI: Official command-line interface for Alibaba Cloud services

Acknowledgements

This crate was developed with the help of the following resources:

  • Aliyun DNS API documentation
  • serde: A Rust library for serializing and deserializing data structures efficiently and generically
  • reqwest: An ergonomic, batteries-included HTTP client for Rust

We would like to express our gratitude to the developers and maintainers of these projects, as well as the Rust community as a whole, for their support and inspiration.

Happy coding! 🦀

Structs