-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crate names for services #42
Comments
In #31, I've moved forward with azure_mgmt_${service} where ${service} defaults to the snake_case of the spec directory name at https://github.com/Azure/azure-rest-api-specs/tree/master/specification . The service names can be set by adding an entry to: const SERVICE_NAMES: &[(&str, &str)] = &[("cosmos-db", "cosmos"), ("vmware", "avs")]; It is a map from the spec directory name to the service name we wish to use. We just add an entry and do a For the data plane APIs, I'm currently planning to use azure_svc_${service}. |
This does bring up the point of whether we're fitting a bit too much against ther grain by not using the names used in the spec directory. While |
Naming is hard, which is why I created a private spreadsheet. We can look at the other SDKs, the REST API, & the product name to see what they used as well. I do think we should name it The REST API and the SDKs all use
The product service page, docs, and az cli extension all use
So yes, pretty unclear. Given that the SDKs are for accessing the REST APIs, we should lean towards its naming as well as other SDKs. |
I'm fine with just using the names used in the spec directory for the generated service crates. |
* add azure_mgmt_storage_v2019_06_01 * headers now generated * all local types in same mod * include referenced types * CamelCase for vec types * fix referenced schemas * add referenced schemas recursively * multiple input files ctaggart/autorust#38 * create local structs * move to rest/mgmt_storage/2019-06-01 * unlock build on other branches * add rest/rustfmt.toml * allOf & pub * optional params * default Configuration * added mgmt_storage 2020-08-01-preview * API_VERSION const * api-version from config * query params * map with Vec::is_empty * skip_serializing if readOnly * remove anyhow dependency ctaggart/autorust#26 * remove if statement around api-version param * switch services layout to be like go sdk * add compute_mgmt example * add body and header params * add avs_mgmt * group operations into modules * add resources mgmt * service api versions as features * add two examples * version modules * add avs_private_cloud_list example * vm_list example * switch name back to azure_mgmt_${service} #42 * many compute API versions * add 70 mgmt services * map all respones with error handling * +30 mgmt services, 100 total * use spec folder names * add readme for Azure Service Crates * fix vmware example & add examples to readme * add storage account list to readme * docs are hard
service name
I've been hoping to derive the service name from the Python
package-name
oroutput-folder
. Thepackage-name
was looking like a better option, but let's review a couple of examples. In #34, two of our Rust sdk packages here were namedazure_cosmos
andazure_service_bus
.https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cosmos-db/resource-manager/readme.python.md
package-name: azure-mgmt-cosmosdb
output-folder: $(python-sdks-folder)/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb
https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cosmos-db/data-plane/readme.python.md
package-name: azure-table
output-folder: "$(python-sdks-folder)/sdk/cosmos/azure-cosmos-table/azure/table/_generated"
https://github.com/Azure/azure-rest-api-specs/blob/master/specification/servicebus/resource-manager/readme.md
package-name: azure-mgmt-servicebus
output-folder: $(python-sdks-folder)/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus
https://github.com/Azure/azure-rest-api-specs/blob/master/specification/storage/resource-manager/readme.python.md
package-name: azure-mgmt-storage
output-folder: $(python-sdks-folder)/storage/azure-mgmt-storage/azure/mgmt/storage/
After going through this, I think it is best to not rely on another SDK, but use the specification folder name with a map to rename those that we want to. In this case
specification/cosmos-db
would automatically map tocosmos_db
, but we could have an entry to map it tocosmos
instead. Forspecification/servicebus
, we could add entry to map it toservice_bus
.package name
We need to come up with naming for Azure control plane and data plane. "control plane" aka "resource-manager". In #31, I had the control plane crate name as
azure_mgmt_${service}
, then changed it toazure_mgmt_${service}
, but now think it would be better to change it back. The .NET package name isMicrosoft.Azure.Management.CosmosDB
wereManagement
comes before the service name. It is easy to query for all management packages in the NuGet Gallery. Similarly, the python package name isazure-mgmt-cosmosdb
. What should our Rust control plane package be named:For the data plane, I'm not really sure what to do yet. If we use
azure_mgmt_
orazure_management_
as a prefix for the control plane, it would be nice to use a prefix likeazure_data_
,azure_svc_
, orazure_service_
for the data plane. As an example, let's look at the Azure Data Lake Storage. First, let's look at the URL from marketing:https://azure.microsoft.com/en-us/services/storage/data-lake-storage/
And actually, if we look at the marketing service name for "Azure Cosmos DB":
https://azure.microsoft.com/en-us/services/cosmos-db/
Here are the package names for Azure Data Lake Strorage data plane:
https://github.com/Azure/azure-rest-api-specs/blob/master/specification/storage/data-plane/readme.md
What should the Rust data plane package name be?
Are crate names limited to 64 chars? That is a lot of characters, but may be something to keep in mind.
rust-lang/crates.io#718
The text was updated successfully, but these errors were encountered: