microsoft / vscode-cosmosdb

Azure Databases extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-cosmosdb
MIT License
155 stars 68 forks source link

feature: View CosmosDB collection offer #2252

Closed JasonYeMSFT closed 5 months ago

JasonYeMSFT commented 6 months ago

resolves: https://github.com/microsoft/vscode-cosmosdb/issues/1979

The offer of a CosmosDB NoSQL collection will look like this:

{
  "resource": "dbs/xxx/colls/xxx/",
  "offerType": "Invalid",
  "offerResourceId": "xxx",
  "offerVersion": "V2",
  "content": {
    "offerThroughput": 400,
    "offerIsRUPerMinuteThroughputEnabled": false,
    "offerMinimumThroughputParameters": {
      "maxThroughputEverProvisioned": 400,
      "maxConsumedStorageEverInKB": 0
    }
  },
  "id": "xxx",
  "_rid": "xxx",
  "_self": "offers/xxx/",
  "_etag": "\"some_etag\"",
  "_ts": 123456
}

If the collection is serverless, there is no such offer for it because it scales automatically. Attempting to view its offer would result in an error in the output saying it's not available for a serverless database account.