Open binglekruger opened 2 years ago
Started with two tutorials for using CosmosDB with Mongo APIs (recommended by Bill): https://www.mongodb.com/developer/languages/rust/rust-mongodb-crud-tutorial/ https://github.com/Azure-Samples/azure-cosmos-db-mongodb-rust-getting-started
Found another helpful tutorial: https://jbarszczewski.com/rust-actix-cosmosdb-mongodb-tutorial-api
Created 2 API functions:
get_data
- Display data pools of a specific useradd_data
- Add a new data pool to CosmosDBCONNECTION_STRING="mongodb://ntc-data:zkicQepvrK6B1SySo3vDLQpycrEsSt3WByUE1Zg7SYs47CceytRCzIuP3cu3p09GtY2cREJyJtdc9zSjqlxcvA==@ntc-data.mongo.cosmos.azure.com:10255/?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=@ntc-data@" cargo run
(Copy source code)
curl --header "Content-Type: application/json" \ --request POST \ --data '{"id":"Test Client 01","pool_name":"NTLS third pool","sealed_data":"This is some sealed data"}' \ http://127.0.0.1:8000/api/data
(Copy source code)
curl --header "Content-Type: application/json" \ --request GET \ --data '{"id":"Test Client 02"}' \ http://127.0.0.1:8000/api/data
Create a new branch for the Data Service API