Skip to content

Commit cf10b01

Browse files
authored
update the services readme (#448)
1 parent b8eb0fe commit cf10b01

File tree

7 files changed

+84
-47
lines changed

7 files changed

+84
-47
lines changed

services/README.md

Lines changed: 29 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,43 @@
11
# Azure Service Crates
22

3-
Rust crates for accessing [Azure services](https://azure.microsoft.com/services/). These crates are client libraries generated by [AutoRust](autorust) using the web service [specifications](https://github.com/Azure/azure-rest-api-specs/tree/master/specification) found in Azure/azure-rest-api-specs. The specifications are divided into two categories - [control plane and data plane](https://docs.microsoft.com/azure/azure-resource-manager/management/control-plane-and-data-plane). "You use the control plane to manage resources in your subscription. You use the data plane to use capabilities exposed by your instance of a resource type."
3+
Rust crates for accessing [Azure services](https://azure.microsoft.com/services/). These crates are client libraries generated by [AutoRust](autorust) using the web service [specifications](https://github.com/Azure/azure-rest-api-specs/tree/master/specification). The specifications are divided into two categories - [control plane and data plane](https://docs.microsoft.com/azure/azure-resource-manager/management/control-plane-and-data-plane). "You use the control plane to manage resources in your subscription. You use the data plane to use capabilities exposed by your instance of a resource type."
44

5-
There are 168 specifications. So far, we have generated 100 control plane crates. We expect that number to go up as AutoRust matures and bugs are fixed.
5+
When this document was last updated, there were 185 [control plane crates](mgmt) and 29 [data plane crates](svc).
66

77
## Control Plane Crates
8-
The control plane crates are named `azure_mgmt_${specification_directory}`, such as `azure_mgmt_storage`. Each service may have multiple API versions. Each API version has a set of OpenAPI 2.0 documents, listed under a `Tag` in a [readme.md](https://github.com/Azure/azure-rest-api-specs/blob/master/specification/storage/resource-manager/readme.md) file in a `Configuration` section. Sometimes there are multiple `Tag`s for the same API version. For example, [Tag: package-2018-07](https://github.com/Azure/azure-rest-api-specs/blob/master/specification/storage/resource-manager/readme.md#tag-package-2018-07) and [Tag: package-2018-07-only](https://github.com/Azure/azure-rest-api-specs/blob/master/specification/storage/resource-manager/readme.md#tag-package-2018-07-only). Rust code is generated for each tag and organized as a crate feature. The first tag without `-preview` is selected as the default feature:
8+
The control plane crates are named `azure_mgmt_${servicename}`, such as `azure_mgmt_storage`.
99

10-
``` toml
11-
[features]
12-
default = ["package-2019-06"]
13-
"package-2020-08-preview" = []
14-
"package-2019-06" = []
15-
"package-2019-04" = []
16-
"package-2018-11" = []
17-
"package-2018-07" = []
18-
"package-2018-07-only" = []
19-
"package-2018-03" = []
20-
"package-2018-02" = []
21-
"package-2017-10" = []
22-
"package-2017-06" = []
23-
"package-2016-12" = []
24-
"package-2016-05" = []
25-
"package-2016-01" = []
26-
"package-2015-06" = []
27-
"package-2015-05-preview" = []
28-
```
10+
## Data Plane Crates
11+
The data plane crates will be named `azure_svc_${servicename}`, such as `azure_svc_storage`.
2912

30-
The default feature will be used when this dependency is specified:
31-
``` toml
32-
[dependencies]
33-
azure_mgmt_storage = { git = "https://github.com/Azure/azure-sdk-for-rust" }
13+
## Examples
14+
There are a few examples:
15+
- azure_mgmt_storage
16+
- [storage_account_list](mgmt/storage/examples/storage_account_list.rs)
17+
- azure_mgmt_resources
18+
- [group_create](mgmt/resources/examples/group_create.rs)
19+
- azure_mgmt_compute
20+
- [vm_list](mgmt/compute/examples/vm_list.rs)
21+
- azure_mgmt_vmware
22+
- [private_cloud_list](mgmt/vmware/examples/private_cloud_list.rs)
23+
- azure_svc_batch
24+
- [list_pools](svc/batch/examples/list_pools.rs)
25+
26+
These services are in their own [Rust workspace](Cargo.toml), so you need to change to the `services` directory to run these examples.
27+
``` sh
28+
cd azure-sdk-for-rust/services
29+
cargo run --package azure_mgmt_storage --example storage_account_list
3430
```
3531

36-
To use another tag, for example to try out the newer preview API, you must disable the default:
37-
``` toml
38-
[dependencies]
39-
azure_mgmt_storage = { git = "https://github.com/Azure/azure-sdk-for-rust", default-features = false, features = ["package-2020-08-preview"] }
40-
```
32+
## Dependencies
33+
These creates depend on `azure_core` and `azure_identity`. They are not yet published to [crates.io](https://crates.io/). See the [milestones](https://github.com/Azure/azure-sdk-for-rust/milestones) to see what is left before that happens. Here is an example of adding `azure_svc_batch` as a dependency.
4134

42-
A few use cases require using more than tag. This can be done by [renaming the dependencies](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#renaming-dependencies-in-cargotoml):
4335
``` toml
4436
[dependencies]
45-
azure_mgmt_storage_2019_06 = { package = "azure_mgmt_storage", git = "https://github.com/Azure/azure-sdk-for-rust", default-features = false, features = ["package-2019-06"] }
46-
azure_mgmt_storage_2018_02 = { package = "azure_mgmt_storage", git = "https://github.com/Azure/azure-sdk-for-rust", default-features = false, features = ["package-2018-02"] }
37+
tokio = { version = "1.0", features = ["macros"] }
38+
azure_core = { git = "https://github.com/Azure/azure-sdk-for-rust" }
39+
azure_identity = { git = "https://github.com/Azure/azure-sdk-for-rust" }
40+
azure_svc_batch = { git = "https://github.com/Azure/azure-sdk-for-rust" }
4741
```
4842

49-
## Data Plane Crates
50-
The data plane crates will be named `azure_svc_${specification_directory}`, such as `azure_svc_storage`.
51-
52-
## Examples
53-
There are a few examples:
54-
- [mgmt/storage/examples/storage_account_list.rs](mgmt/storage/examples/storage_account_list.rs)
55-
- [mgmt/resources/examples/group_create.rs](mgmt/resources/examples/group_create.rs)
56-
- [mgmt/compute/examples/vm_list.rs](mgmt/compute/examples/vm_list.rs)
57-
- [mgmt/vmware/examples/vmware_private_cloud_list.rs](mgmt/vmware/examples/vmware_private_cloud_list.rs)
43+
Each crate may support several [API versions](api-versions.md).

services/api-versions.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# API Versions
2+
3+
Each service may have multiple API versions. Each API version has a set of OpenAPI 2.0 documents, listed under a `Tag` in a [readme.md](https://github.com/Azure/azure-rest-api-specs/blob/master/specification/storage/resource-manager/readme.md) file in a `Configuration` section. Sometimes there are multiple `Tag`s for the same API version. For example, [Tag: package-2018-07](https://github.com/Azure/azure-rest-api-specs/blob/master/specification/storage/resource-manager/readme.md#tag-package-2018-07) and [Tag: package-2018-07-only](https://github.com/Azure/azure-rest-api-specs/blob/master/specification/storage/resource-manager/readme.md#tag-package-2018-07-only). Rust code is generated for each tag and organized as a crate feature. The first tag without `-preview` is selected as the default feature:
4+
5+
``` toml
6+
[features]
7+
default = ["package-2019-06"]
8+
"package-2020-08-preview" = []
9+
"package-2019-06" = []
10+
"package-2019-04" = []
11+
"package-2018-11" = []
12+
"package-2018-07" = []
13+
"package-2018-07-only" = []
14+
"package-2018-03" = []
15+
"package-2018-02" = []
16+
"package-2017-10" = []
17+
"package-2017-06" = []
18+
"package-2016-12" = []
19+
"package-2016-05" = []
20+
"package-2016-01" = []
21+
"package-2015-06" = []
22+
"package-2015-05-preview" = []
23+
```
24+
25+
The default feature will be used when this dependency is specified:
26+
``` toml
27+
[dependencies]
28+
azure_mgmt_storage = { git = "https://github.com/Azure/azure-sdk-for-rust" }
29+
```
30+
31+
To use another tag, for example to try out the newer preview API, you must disable the default:
32+
``` toml
33+
[dependencies]
34+
azure_mgmt_storage = { git = "https://github.com/Azure/azure-sdk-for-rust", default-features = false, features = ["package-2020-08-preview"] }
35+
```
36+
37+
A few use cases require using more than tag. This can be accomplished a couple of ways. Specify the feature `no-default-version` and the other tags you wish to use.
38+
39+
``` toml
40+
[dependencies]
41+
azure_mgmt_storage = { git = "https://github.com/Azure/azure-sdk-for-rust", features = ["no-default-version", "package-2019-06", "package-2018-02"] }
42+
```
43+
44+
Or it can be done by [renaming the dependencies](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#renaming-dependencies-in-cargotoml):
45+
``` toml
46+
[dependencies]
47+
azure_mgmt_storage_2019_06 = { package = "azure_mgmt_storage", git = "https://github.com/Azure/azure-sdk-for-rust", default-features = false, features = ["package-2019-06"] }
48+
azure_mgmt_storage_2018_02 = { package = "azure_mgmt_storage", git = "https://github.com/Azure/azure-sdk-for-rust", default-features = false, features = ["package-2018-02"] }
49+
```

services/mgmt/compute/examples/vm_list.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/mgmt/resources/examples/group_create.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/mgmt/storage/examples/storage_account_list.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/mgmt/vmware/examples/vmware_private_cloud_list.rs renamed to services/mgmt/vmware/examples/private_cloud_list.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/svc/batch/examples/list_pools.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/*
22
Prints the name of pools using the data plane APIs
3+
4+
cargo run --package azure_svc_batch --example list_pools
35
*/
46

57
use azure_identity::token_credentials::AzureCliCredential;

0 commit comments

Comments
 (0)