Skip to content

Latest commit

 

History

History
174 lines (119 loc) · 6.22 KB

README.md

File metadata and controls

174 lines (119 loc) · 6.22 KB

credentials

Credentials API

  • API version: 7.0.26

Manage credentials for transaction tests using the Credentials API.

The following permissions are required to access Credentials API operations:

  • Settings Tests Read for read operations.
  • Settings Tests Update for write operations.
  • View sensitive data in web transaction scripts to view the encrypted value property of credentials.
  • Settings Tests Create Transaction (Tx) Tests to create credentials.

For more information about credentials, see Working With Secure Credentials.

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 11+
  2. Maven/Gradle

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependencies>
    <dependency>
        <groupId>com.thousandeyes.sdk</groupId>
        <artifactId>credentials</artifactId>
        <version>version</version>
    </dependency>
    <dependency>
        <groupId>com.thousandeyes.sdk</groupId>
        <artifactId>client</artifactId>
        <version>version</version>
    </dependency>

    <!-- Example only, you can use your own client implementation -->
    <dependency>
        <groupId>com.thousandeyes.sdk</groupId>
        <artifactId>client-native</artifactId>
        <version>version</version>
    </dependency>
</dependencies>

Gradle users

Add this dependency to your project's build file:

implementation "com.thousandeyes.sdk:client:<version>"
implementation "com.thousandeyes.sdk:client-native:<version>" #Example only, you can use your own client implementation
implementation "com.thousandeyes.sdk:credentials:<version>"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/credentials-version.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import com.thousandeyes.sdk.*;
import com.thousandeyes.sdk.client.*;
import com.thousandeyes.sdk.credentials.model.*;
import com.thousandeyes.sdk.credentials.CredentialsApi;

public class CredentialsApiExample {

    public static void main(String[] args) {
        // Configure clients using the `defaultClient` object, such as
        // overriding the host and port, timeout, etc. In this example we are using the NativeApiClient
        // but you can use your own client implementation
        ApiClient defaultClient = NativeApiClient
                .builder()
                .baseUri("https://api.thousandeyes.com/v7")
                .bearerToken("<bearer-token>")
                .build();

        CredentialsApi apiInstance = new CredentialsApi(defaultClient);
        CredentialRequest credentialRequest = new CredentialRequest(); // CredentialRequest | 
        String aid = "1234"; // String | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
        try {
            CredentialWithoutValue result = apiInstance.createCredential(credentialRequest, aid);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CredentialsApi#createCredential");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.thousandeyes.com/v7

Class Method HTTP request Description
CredentialsApi createCredential POST /credentials Create credential
CredentialsApi createCredentialWithHttpInfo POST /credentials Create credential
CredentialsApi deleteCredential DELETE /credentials/{id} Delete credential
CredentialsApi deleteCredentialWithHttpInfo DELETE /credentials/{id} Delete credential
CredentialsApi getCredential GET /credentials/{id} Retrieve credential
CredentialsApi getCredentialWithHttpInfo GET /credentials/{id} Retrieve credential
CredentialsApi getCredentials GET /credentials List credentials
CredentialsApi getCredentialsWithHttpInfo GET /credentials List credentials
CredentialsApi updateCredential PUT /credentials/{id} Update credential
CredentialsApi updateCredentialWithHttpInfo PUT /credentials/{id} Update credential

Documentation for Authorization

Authentication schemes defined for the API:

BearerAuth

  • Type: HTTP Bearer Token authentication

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues. However, the instances of the api clients created from the ApiClient are thread-safe and can be re-used.

Author