Skip to content
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

Add table azure_cosmosdb_mongo_collection. Closes #588 #589

Merged
merged 9 commits into from
Mar 24, 2023

Conversation

karanpopat
Copy link
Contributor

@karanpopat karanpopat commented Mar 24, 2023

Integration test logs

Logs
Outputs:

resource_aka = "azure:///subscriptions/abcd7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest82791/providers/Microsoft.DocumentDB/databaseAccounts/turbottest82791/mongodbDatabases/turbottest82791/collections/turbottest82791"
resource_aka_lower = "azure:///subscriptions/abcd7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest82791/providers/microsoft.documentdb/databaseaccounts/turbottest82791/mongodbdatabases/turbottest82791/collections/turbottest82791"
resource_id = "/subscriptions/abcd7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest82791/providers/Microsoft.DocumentDB/databaseAccounts/turbottest82791/mongodbDatabases/turbottest82791/collections/turbottest82791"
resource_name = "turbottest82791"

Running SQL query: test-get-query.sql
[
  {
    "account_name": "turbottest82791",
    "database_name": "turbottest82791",
    "id": "/subscriptions/abcd7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest82791/providers/Microsoft.DocumentDB/databaseAccounts/turbottest82791/mongodbDatabases/turbottest82791/collections/turbottest82791",
    "name": "turbottest82791",
    "region": "east us",
    "resource_group": "turbottest82791"
  }
]
✔ PASSED

Running SQL query: test-hydrate-query.sql
[
  {
    "account_name": "turbottest82791",
    "database_name": "turbottest82791",
    "id": "/subscriptions/abcd7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest82791/providers/Microsoft.DocumentDB/databaseAccounts/turbottest82791/mongodbDatabases/turbottest82791/collections/turbottest82791",
    "name": "turbottest82791",
    "region": "east us",
    "resource_group": "turbottest82791"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "account_name": "turbottest82791",
    "database_name": "turbottest82791",
    "id": "/subscriptions/abcd7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest82791/providers/Microsoft.DocumentDB/databaseAccounts/turbottest82791/mongodbDatabases/turbottest82791/collections/turbottest82791",
    "name": "turbottest82791",
    "region": "east us",
    "resource_group": "turbottest82791"
  }
]
✔ PASSED

Running SQL query: test-not-found-query.sql
null
✔ PASSED

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "azure:///subscriptions/abcd7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbottest82791/providers/Microsoft.DocumentDB/databaseAccounts/turbottest82791/mongodbDatabases/turbottest82791/collections/turbottest82791",
      "azure:///subscriptions/abcd7416-f95f-4771-bbb5-529d4c76659c/resourcegroups/turbottest82791/providers/microsoft.documentdb/databaseaccounts/turbottest82791/mongodbdatabases/turbottest82791/collections/turbottest82791"
    ],
    "name": "turbottest82791",
    "title": "turbottest82791"
  }
]
✔ PASSED

POSTTEST: tests/azure_cosmosdb_mongo_collection

TEARDOWN: tests/azure_cosmosdb_mongo_collection

SUMMARY:

1/1 passed.

Example query results

Results
> select
  c.name,
  c.database_name,
  c.account_name,
  c.region,
  c.resource_group,
  c.shard_key,
  c.id
from
  azure_cosmosdb_mongo_collection c,
  azure_cosmosdb_mongo_database d
where
  c.database_name = d.name;
+------------+---------------+------------------------+---------+----------------+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| name       | database_name | account_name           | region  | resource_group | shard_key             | id                                                                                                                                                                                                   |
+------------+---------------+------------------------+---------+----------------+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| demo-coll1 | demo-mongo-db | demo-insight-mongo-acc | west us | demo           | {"unique_key":"Hash"} | /subscriptions/abcd7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/demo/providers/Microsoft.DocumentDB/databaseAccounts/demo-insight-mongo-acc/mongodbDatabases/demo-mongo-db/collections/demo-coll1 |
+------------+---------------+------------------------+---------+----------------+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

@karanpopat karanpopat linked an issue Mar 24, 2023 that may be closed by this pull request
@karanpopat karanpopat changed the title 588 add table azure cosmosdb mongo collection Add table azure cosmosdb_mongo_collection. Closes #588 Mar 24, 2023
@karanpopat karanpopat changed the title Add table azure cosmosdb_mongo_collection. Closes #588 Add table azure_cosmosdb_mongo_collection. Closes #588 Mar 24, 2023
@karanpopat karanpopat marked this pull request as ready for review March 24, 2023 10:13
Copy link
Contributor

@ParthaI ParthaI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karanpopat please see the comments and make changes where ever required. Thanks!

azure/table_azure_cosmosdb_mongo_collection.go Outdated Show resolved Hide resolved
azure/table_azure_cosmosdb_mongo_collection.go Outdated Show resolved Hide resolved
@karanpopat karanpopat requested a review from ParthaI March 24, 2023 13:12
Copy link
Contributor

@misraved misraved left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at the review comments. Thanks!!

docs/tables/azure_cosmosdb_mongo_collection.md Outdated Show resolved Hide resolved
Co-authored-by: Ved misra <47312748+misraved@users.noreply.github.com>
@misraved misraved merged commit dc994bd into main Mar 24, 2023
@misraved misraved deleted the 588-add-table-azure_cosmosdb_mongo_collection branch March 24, 2023 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add table azure_cosmosdb_mongo_collection
3 participants