Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Piiano Vault REST API
* --- sidebar_position: 1 sidebar_label: Overview description: The Piiano Vault REST API enables you to access and manage collections, objects, tokens, users, policies, and other resources within Piiano Vault. slug: / --- # Introduction The Piiano Vault REST API enables you to access and manage collections, objects, tokens, users, policies, and other resources within Piiano Vault in a simple, programmatic way using conventional HTTP requests and standard HTTP response codes. The API follows RESTful conventions when possible, with most operations performed by `GET`, `POST`, `PUT`, `PATCH`, and `DELETE` requests. Request and response bodies are [JSON-encoded](https://www.json.org/json-en.html). However, for collection operations, an SQL-like [PVSchema](/guides/reference/pvschema) encoding is available. This API reference provides details for each operation available in the API. When you install a local copy of Vault, you can try each operation using **Send API request**. An OpenAPI specification is available in [YAML](@site/static/assets/openapi.yaml) and [JSON](@site/static/assets/openapi.json) formats and can be used to generate client code for the API.
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.piiano.vault.client.openapi;
import com.piiano.vault.client.openapi.ApiCallback;
import com.piiano.vault.client.openapi.ApiClient;
import com.piiano.vault.client.openapi.ApiException;
import com.piiano.vault.client.openapi.ApiResponse;
import com.piiano.vault.client.openapi.Configuration;
import com.piiano.vault.client.openapi.Pair;
import com.piiano.vault.client.openapi.ProgressRequestBody;
import com.piiano.vault.client.openapi.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.piiano.vault.client.openapi.model.APIKey;
import com.piiano.vault.client.openapi.model.APIKeyExpiry;
import com.piiano.vault.client.openapi.model.AdminAPIKey;
import com.piiano.vault.client.openapi.model.IAMConfig;
import com.piiano.vault.client.openapi.model.RestHTTPError;
import com.piiano.vault.client.openapi.model.UserDetails;
import com.piiano.vault.client.openapi.model.UserName;
import com.piiano.vault.client.openapi.model.UserNameExpiry;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class IamApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public IamApi() {
this(Configuration.getDefaultApiClient());
}
public IamApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for getIamConf
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The requested resource is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public okhttp3.Call getIamConfCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/pvlt/1.0/ctl/iam/conf";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/toml",
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getIamConfValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getIamConfCall(_callback);
}
/**
* Get IAM configuration
* Gets the identity and access management (IAM) configuration in TOML format. The role that performs this operation must have the `CapIAMReader` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations.
* @return IAMConfig
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The requested resource is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public IAMConfig getIamConf() throws ApiException {
ApiResponse localVarResp = getIamConfWithHttpInfo();
return localVarResp.getData();
}
/**
* Get IAM configuration
* Gets the identity and access management (IAM) configuration in TOML format. The role that performs this operation must have the `CapIAMReader` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations.
* @return ApiResponse<IAMConfig>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The requested resource is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public ApiResponse getIamConfWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getIamConfValidateBeforeCall(null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get IAM configuration (asynchronously)
* Gets the identity and access management (IAM) configuration in TOML format. The role that performs this operation must have the `CapIAMReader` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations.
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The requested resource is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public okhttp3.Call getIamConfAsync(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getIamConfValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getUser
* @param user The name of the user. (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The user is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public okhttp3.Call getUserCall(String user, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/pvlt/1.0/ctl/iam/user/{user}"
.replace("{" + "user" + "}", localVarApiClient.escapeString(user.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getUserValidateBeforeCall(String user, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'user' is set
if (user == null) {
throw new ApiException("Missing the required parameter 'user' when calling getUser(Async)");
}
return getUserCall(user, _callback);
}
/**
* Get a user details
* Get a user's details. The role that performs this operation must have the `CapIAMReader` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations.
* @param user The name of the user. (required)
* @return UserDetails
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The user is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public UserDetails getUser(String user) throws ApiException {
ApiResponse localVarResp = getUserWithHttpInfo(user);
return localVarResp.getData();
}
/**
* Get a user details
* Get a user's details. The role that performs this operation must have the `CapIAMReader` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations.
* @param user The name of the user. (required)
* @return ApiResponse<UserDetails>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The user is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public ApiResponse getUserWithHttpInfo(String user) throws ApiException {
okhttp3.Call localVarCall = getUserValidateBeforeCall(user, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get a user details (asynchronously)
* Get a user's details. The role that performs this operation must have the `CapIAMReader` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations.
* @param user The name of the user. (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The user is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public okhttp3.Call getUserAsync(String user, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getUserValidateBeforeCall(user, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for regenerateUserApiKey
* @param userName The name of the user to regenerate API key for. (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights or attempts to generate a key for the admin user.
-
404
The user is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public okhttp3.Call regenerateUserApiKeyCall(UserName userName, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = userName;
// create path and map variables
String localVarPath = "/api/pvlt/1.0/ctl/iam/user/regen";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call regenerateUserApiKeyValidateBeforeCall(UserName userName, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'userName' is set
if (userName == null) {
throw new ApiException("Missing the required parameter 'userName' when calling regenerateUserApiKey(Async)");
}
return regenerateUserApiKeyCall(userName, _callback);
}
/**
* Regenerate user API key
* Regenerates a user's API key. The existing API key is invalidated. This operation is irreversible. :::note You cannot regenerate the key for the Admin user. See [Set the admin's API key](/guides/manage-users-and-policies/set-admin-api-key) for information on how to set a value for this key. ::: The role that performs this operation must have the `CapIAMWriter` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations.
* @param userName The name of the user to regenerate API key for. (required)
* @return APIKey
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights or attempts to generate a key for the admin user.
-
404
The user is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public APIKey regenerateUserApiKey(UserName userName) throws ApiException {
ApiResponse localVarResp = regenerateUserApiKeyWithHttpInfo(userName);
return localVarResp.getData();
}
/**
* Regenerate user API key
* Regenerates a user's API key. The existing API key is invalidated. This operation is irreversible. :::note You cannot regenerate the key for the Admin user. See [Set the admin's API key](/guides/manage-users-and-policies/set-admin-api-key) for information on how to set a value for this key. ::: The role that performs this operation must have the `CapIAMWriter` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations.
* @param userName The name of the user to regenerate API key for. (required)
* @return ApiResponse<APIKey>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights or attempts to generate a key for the admin user.
-
404
The user is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public ApiResponse regenerateUserApiKeyWithHttpInfo(UserName userName) throws ApiException {
okhttp3.Call localVarCall = regenerateUserApiKeyValidateBeforeCall(userName, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Regenerate user API key (asynchronously)
* Regenerates a user's API key. The existing API key is invalidated. This operation is irreversible. :::note You cannot regenerate the key for the Admin user. See [Set the admin's API key](/guides/manage-users-and-policies/set-admin-api-key) for information on how to set a value for this key. ::: The role that performs this operation must have the `CapIAMWriter` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations.
* @param userName The name of the user to regenerate API key for. (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights or attempts to generate a key for the admin user.
-
404
The user is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public okhttp3.Call regenerateUserApiKeyAsync(UserName userName, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = regenerateUserApiKeyValidateBeforeCall(userName, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for setAdminApiKey
* @param adminAPIKey The API key of the Admin user to set. (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights or attempts to set a password for the Admin user.
-
404
The requested resource is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public okhttp3.Call setAdminApiKeyCall(AdminAPIKey adminAPIKey, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = adminAPIKey;
// create path and map variables
String localVarPath = "/api/pvlt/1.0/ctl/iam/admin/set-api-key";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call setAdminApiKeyValidateBeforeCall(AdminAPIKey adminAPIKey, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'adminAPIKey' is set
if (adminAPIKey == null) {
throw new ApiException("Missing the required parameter 'adminAPIKey' when calling setAdminApiKey(Async)");
}
return setAdminApiKeyCall(adminAPIKey, _callback);
}
/**
* Set Admin API key
* Set the API key of the Admin user. Vault always has an Admin user account, which you use to update the configuration of Vault. The API key should meet the specified criteria: - It must be at least 15 characters long. - It must contain a mix of digits, lowercase letters, and uppercase letters. This API is restricted to the `Admin` user. The Admin API Key can be also set using the [environment variable `PVAULT_SERVICE_ADMIN_API_KEY`](/guides/configure/environment-variables#service-and-features)
* @param adminAPIKey The API key of the Admin user to set. (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights or attempts to set a password for the Admin user.
-
404
The requested resource is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public void setAdminApiKey(AdminAPIKey adminAPIKey) throws ApiException {
setAdminApiKeyWithHttpInfo(adminAPIKey);
}
/**
* Set Admin API key
* Set the API key of the Admin user. Vault always has an Admin user account, which you use to update the configuration of Vault. The API key should meet the specified criteria: - It must be at least 15 characters long. - It must contain a mix of digits, lowercase letters, and uppercase letters. This API is restricted to the `Admin` user. The Admin API Key can be also set using the [environment variable `PVAULT_SERVICE_ADMIN_API_KEY`](/guides/configure/environment-variables#service-and-features)
* @param adminAPIKey The API key of the Admin user to set. (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights or attempts to set a password for the Admin user.
-
404
The requested resource is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public ApiResponse setAdminApiKeyWithHttpInfo(AdminAPIKey adminAPIKey) throws ApiException {
okhttp3.Call localVarCall = setAdminApiKeyValidateBeforeCall(adminAPIKey, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Set Admin API key (asynchronously)
* Set the API key of the Admin user. Vault always has an Admin user account, which you use to update the configuration of Vault. The API key should meet the specified criteria: - It must be at least 15 characters long. - It must contain a mix of digits, lowercase letters, and uppercase letters. This API is restricted to the `Admin` user. The Admin API Key can be also set using the [environment variable `PVAULT_SERVICE_ADMIN_API_KEY`](/guides/configure/environment-variables#service-and-features)
* @param adminAPIKey The API key of the Admin user to set. (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights or attempts to set a password for the Admin user.
-
404
The requested resource is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public okhttp3.Call setAdminApiKeyAsync(AdminAPIKey adminAPIKey, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = setAdminApiKeyValidateBeforeCall(adminAPIKey, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for setIamConf
* @param iaMConfig IAM configuration in TOML format. (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The requested resource is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public okhttp3.Call setIamConfCall(IAMConfig iaMConfig, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = iaMConfig;
// create path and map variables
String localVarPath = "/api/pvlt/1.0/ctl/iam/conf";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/toml"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call setIamConfValidateBeforeCall(IAMConfig iaMConfig, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'iaMConfig' is set
if (iaMConfig == null) {
throw new ApiException("Missing the required parameter 'iaMConfig' when calling setIamConf(Async)");
}
return setIamConfCall(iaMConfig, _callback);
}
/**
* Set IAM configuration
* Sets the identity and access management (IAM) configuration. The role that performs this operation must have the `CapIAMWriter` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations.
* @param iaMConfig IAM configuration in TOML format. (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The requested resource is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public void setIamConf(IAMConfig iaMConfig) throws ApiException {
setIamConfWithHttpInfo(iaMConfig);
}
/**
* Set IAM configuration
* Sets the identity and access management (IAM) configuration. The role that performs this operation must have the `CapIAMWriter` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations.
* @param iaMConfig IAM configuration in TOML format. (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The requested resource is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public ApiResponse setIamConfWithHttpInfo(IAMConfig iaMConfig) throws ApiException {
okhttp3.Call localVarCall = setIamConfValidateBeforeCall(iaMConfig, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Set IAM configuration (asynchronously)
* Sets the identity and access management (IAM) configuration. The role that performs this operation must have the `CapIAMWriter` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations.
* @param iaMConfig IAM configuration in TOML format. (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The requested resource is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public okhttp3.Call setIamConfAsync(IAMConfig iaMConfig, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = setIamConfValidateBeforeCall(iaMConfig, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for updateApiKeyExpiration
* @param userNameExpiry The name of the user and the expiration in seconds to update API key. (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The user is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public okhttp3.Call updateApiKeyExpirationCall(UserNameExpiry userNameExpiry, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = userNameExpiry;
// create path and map variables
String localVarPath = "/api/pvlt/1.0/ctl/iam/user/update-expiration";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "bearerAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateApiKeyExpirationValidateBeforeCall(UserNameExpiry userNameExpiry, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'userNameExpiry' is set
if (userNameExpiry == null) {
throw new ApiException("Missing the required parameter 'userNameExpiry' when calling updateApiKeyExpiration(Async)");
}
return updateApiKeyExpirationCall(userNameExpiry, _callback);
}
/**
* Update user API key expiration
* Update a user's API key expiration. The role that performs this operation must have the `CapIAMWriter` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations.
* @param userNameExpiry The name of the user and the expiration in seconds to update API key. (required)
* @return APIKeyExpiry
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The user is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public APIKeyExpiry updateApiKeyExpiration(UserNameExpiry userNameExpiry) throws ApiException {
ApiResponse localVarResp = updateApiKeyExpirationWithHttpInfo(userNameExpiry);
return localVarResp.getData();
}
/**
* Update user API key expiration
* Update a user's API key expiration. The role that performs this operation must have the `CapIAMWriter` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations.
* @param userNameExpiry The name of the user and the expiration in seconds to update API key. (required)
* @return ApiResponse<APIKeyExpiry>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The user is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public ApiResponse updateApiKeyExpirationWithHttpInfo(UserNameExpiry userNameExpiry) throws ApiException {
okhttp3.Call localVarCall = updateApiKeyExpirationValidateBeforeCall(userNameExpiry, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Update user API key expiration (asynchronously)
* Update a user's API key expiration. The role that performs this operation must have the `CapIAMWriter` capability. See [Access control](/data-security/identity-and-access-management#access-control) for more information about how capabilities are used to control access to operations.
* @param userNameExpiry The name of the user and the expiration in seconds to update API key. (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The request is successful.
-
400
The request is invalid.
-
401
Authentication credentials are incorrect or missing.
-
403
The caller doesn't have the required access rights.
-
404
The user is not found.
-
405
The operation is not allowed.
-
409
A conflict occurs.
-
410
Access to a resource that is no longer available occurs.
-
500
An error occurs on the server.
-
503
The service is unavailable.
-
*/
public okhttp3.Call updateApiKeyExpirationAsync(UserNameExpiry userNameExpiry, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = updateApiKeyExpirationValidateBeforeCall(userNameExpiry, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}