Overview

This component assists in testing Microsoft Energy Data Services REST APIs to execute underlying service API calls or perform functional flows.

Getting Started

There are many different ways that REST APIs can be called from the use of simple curl commands to complex Postman projects. For this lab, a Rest Client will be used for a simple way to send a request. This extension allows for simple http scripts to be executed and leverages Visual Studio Settings to be able to easily point to different environments.

  1. Install Visual Studio Code
  2. Download and install REST Client for Visual Studio Code
  3. Download, extract, and open REST Scripts in Visual Studio Code
  4. In Visual Studio Code please open the Preferences/Settings and directly edit the settings.json file. This file can also be opened using the VSCode Command Palette and searching for: `Preferences: Open Settings (JSON)`.
  5. Paste the following JSON into the settings.json file and save it which allows for the use of the REST Client Environments.
  6. 
            "rest-client.environmentVariables": {
                "{{this.instanceName}}": {
                    "TENANT_ID": "{{this.tenantId}}",
                    "CLIENT_ID": "{{this.clientId}}",
                    "HOST": "{{this.host}}",
                    "DATA_PARTITION": "{{this.dataPartition}}",
                    "DEVELOPER_PORTAL": "{{this.developerPortalUrl}}",
                    "REFRESH_TOKEN": "{{this.refreshToken}}"
                }
            }
          
  7. Open the VSCode Command Pallette and choose `Rest Client: Switch Environment`, and select {{this.instanceName}}.

Perform a Core Functionality Validation Test.

Basic core functionality for includes: the creation of a legal tag, the submission of a storage record, and then the search and retrieval for that record.

Execute Send Requests

Send Requests from rest/check-core.http

Perform a Manifest Ingestion

Basic manifest ingestion functionality includes: the creation of a legal tag, triggering a workflow, retrieving the status, waiting for completion, and then querying for the data uploaded.

Execute Send Requests

Send Requests from rest/check-csv.http

Perform a CSV Ingestion

Basic csv data ingestion functionality includes: the creation of a legal tag, creation of a schema, retrieval of an Upload URL, uploading a CSV file to that URL, triggering the workflow, retrieving the status, waiting for completion, and then querying the data uploaded.

Execute Send Requests

Send Requests from rest/check-csv.http