Skip to content

Commit

Permalink
remove /status + fix test (#1629)
Browse files Browse the repository at this point in the history
Co-authored-by: Anat Balzam <[email protected]>
  • Loading branch information
anatbal and anatbal authored Mar 30, 2022
1 parent e5d4a76 commit 0741ad6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
Binary file modified docs/assets/quickstart_swaggerui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 21 additions & 9 deletions docs/tre-admins/setup-instructions/deploying-azure-tre.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,34 @@ make letsencrypt

### Using curl

Use `curl` to make a simple request to the status endpoint of the API:
Use `curl` to make a simple request to the health endpoint of the API:

```bash
curl https://<azure_tre_fqdn>/api/status
curl https://<azure_tre_fqdn>/api/health
```

The expected response is:

```json
{"services":[{"service":"Cosmos DB","status":"OK","message":""}]}
```

You can also create a request to the `api/health` endpoint to verify that the API is deployed and responds. You should see a *pong* response as a result of the request below:

```cmd
curl https://<azure_tre_fqdn>/api/health
{
"services": [
{
"service": "Cosmos DB",
"status": "OK",
"message": ""
},
{
"service": "Service Bus",
"status": "OK",
"message": ""
},
{
"service": "Resource Processor",
"status": "OK",
"message": ""
}
]
}
```

### Using the API docs
Expand Down
1 change: 0 additions & 1 deletion e2e_tests/resources/strings.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
PONG = "pong"

API_HEALTH = "/api/health"
API_STATUS = "/api/status"
API_WORKSPACE_TEMPLATES = "/api/workspace-templates"
API_WORKSPACES = "/api/workspaces"
API_WORKSPACE_SERVICE_TEMPLATES = "/api/workspace-service-templates"
Expand Down
14 changes: 6 additions & 8 deletions e2e_tests/test_provisioned_health_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@
pytestmark = pytest.mark.asyncio


@pytest.mark.smoke
async def test_health() -> None:
async with AsyncClient(verify=False) as client:
url = f"https://{config.TRE_ID}.{config.RESOURCE_LOCATION}.cloudapp.azure.com{strings.API_HEALTH}"
response = await client.get(url)
assert response.json()["message"] == strings.PONG


async def test_status() -> None:
async with AsyncClient(verify=False) as client:
url = f"https://{config.TRE_ID}.{config.RESOURCE_LOCATION}.cloudapp.azure.com{strings.API_STATUS}"
response = await client.get(url)
assert response.status_code == 200
assert response.json()["services"] == [{'service': 'Cosmos DB', 'status': 'OK', 'message': ''}]
assert response.json()["services"] == [
{"service": "Cosmos DB", "status": "OK", "message": ""},
{"service": "Service Bus", "status": "OK", "message": ""},
{"service": "Resource Processor", "status": "OK", "message": ""},
]

0 comments on commit 0741ad6

Please sign in to comment.