Skip to content

Latest commit

 

History

History
183 lines (125 loc) · 7.43 KB

README.md

File metadata and controls

183 lines (125 loc) · 7.43 KB

usage

Usage API

  • API version: 7.0.15

These usage endpoints define the following operations:

  • Usage: Retrieve usage data for the specified time period (default is one month).

    • Users must have the View organization usage permission to access this endpoint.
    • This endpoint offers visibility across all account groups within the organization.
    • Users with View organization usage permission in multiple organizations should query the endpoint with the aid query string parameter (see optional parameters) for each organization.
  • Quotas: Obtain organization and account usage quotas. Additionally, users with the appropriate permissions can create, update, or delete these quotas.

    • Users must have the necessary permissions to perform quota-related actions.

Refer to the Usage API endpoints for detailed usage instructions and optional parameters.

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>usage</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:usage:<version>"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/usage-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.usage.model.*;
import com.thousandeyes.sdk.usage.QuotasApi;

public class QuotasApiExample {

    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();

        QuotasApi apiInstance = new QuotasApi(defaultClient);
        OrganizationsQuotasAssign organizationsQuotasAssign = new OrganizationsQuotasAssign(); // OrganizationsQuotasAssign | 
        try {
            OrganizationsQuotasAssign result = apiInstance.assignOrganizationsAccountGroupsQuotas(organizationsQuotasAssign);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling QuotasApi#assignOrganizationsAccountGroupsQuotas");
            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
QuotasApi assignOrganizationsAccountGroupsQuotas POST /quotas/account-groups/assign Create or update accout group quotas
QuotasApi assignOrganizationsAccountGroupsQuotasWithHttpInfo POST /quotas/account-groups/assign Create or update accout group quotas
QuotasApi assignOrganizationsQuotas POST /quotas/assign Create or update organizations quotas
QuotasApi assignOrganizationsQuotasWithHttpInfo POST /quotas/assign Create or update organizations quotas
QuotasApi getQuotas GET /quotas Get organization and account group usage quota
QuotasApi getQuotasWithHttpInfo GET /quotas Get organization and account group usage quota
QuotasApi unassignOrganizationsAccountGroupsQuotas POST /quotas/account-groups/unassign Remove account group quotas from organizations
QuotasApi unassignOrganizationsAccountGroupsQuotasWithHttpInfo POST /quotas/account-groups/unassign Remove account group quotas from organizations
QuotasApi unassignOrganizationsQuotas POST /quotas/unassign Remove organization quotas
QuotasApi unassignOrganizationsQuotasWithHttpInfo POST /quotas/unassign Remove organization quotas
UsageApi getEnterpriseAgentsUnitsUsage GET /usage/units/enterprise-agents Get enterprise agent usage
UsageApi getEnterpriseAgentsUnitsUsageWithHttpInfo GET /usage/units/enterprise-agents Get enterprise agent usage
UsageApi getTestsUnitsUsage GET /usage/units/tests Get cloud and enterprise agents units usage
UsageApi getTestsUnitsUsageWithHttpInfo GET /usage/units/tests Get cloud and enterprise agents units usage
UsageApi getUsage GET /usage Get usage information for the last month
UsageApi getUsageWithHttpInfo GET /usage Get usage information for the last month

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