version 1.5

This commit is contained in:
Johannes Holzwarth | SE-Inno GmbH
2024-01-11 14:04:25 +01:00
parent 0ee8291846
commit 4492763b78
756 changed files with 209957 additions and 2 deletions
@@ -0,0 +1,676 @@
<?php
/**
* AuthorizationsService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* AuthorizationsService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class AuthorizationsService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation deleteAuthorizationsID
*
* Delete an authorization
*
* @param string $auth_id The ID of the authorization to delete. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function deleteAuthorizationsID($auth_id, $zap_trace_span = null)
{
$this->deleteAuthorizationsIDWithHttpInfo($auth_id, $zap_trace_span);
}
/**
* Operation deleteAuthorizationsIDWithHttpInfo
*
* Delete an authorization
*
* @param string $auth_id The ID of the authorization to delete. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function deleteAuthorizationsIDWithHttpInfo($auth_id, $zap_trace_span = null)
{
$request = $this->deleteAuthorizationsIDRequest($auth_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'deleteAuthorizationsID'
*
* @param string $auth_id The ID of the authorization to delete. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function deleteAuthorizationsIDRequest($auth_id, $zap_trace_span = null)
{
// verify the required parameter 'auth_id' is set
if ($auth_id === null || (is_array($auth_id) && count($auth_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $auth_id when calling deleteAuthorizationsID'
);
}
$resourcePath = '/api/v2/authorizations/{authID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($auth_id !== null) {
$resourcePath = str_replace(
'{' . 'authID' . '}',
ObjectSerializer::toPathValue($auth_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('DELETE', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getAuthorizations
*
* List authorizations
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $user_id A user ID. Only returns authorizations scoped to this user. (optional)
* @param string $user A user name. Only returns authorizations scoped to this user. (optional)
* @param string $org_id An organization ID. Only returns authorizations that belong to this organization. (optional)
* @param string $org An organization name. Only returns authorizations that belong to this organization. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Authorizations|string|object|\InfluxDB2\Model\Error|string
*/
public function getAuthorizations($zap_trace_span = null, $user_id = null, $user = null, $org_id = null, $org = null)
{
list($response) = $this->getAuthorizationsWithHttpInfo($zap_trace_span, $user_id, $user, $org_id, $org);
return $response;
}
/**
* Operation getAuthorizationsWithHttpInfo
*
* List authorizations
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $user_id A user ID. Only returns authorizations scoped to this user. (optional)
* @param string $user A user name. Only returns authorizations scoped to this user. (optional)
* @param string $org_id An organization ID. Only returns authorizations that belong to this organization. (optional)
* @param string $org An organization name. Only returns authorizations that belong to this organization. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Authorizations|string|object|\InfluxDB2\Model\Error|string, HTTP status code, HTTP response headers (array of strings)
*/
public function getAuthorizationsWithHttpInfo($zap_trace_span = null, $user_id = null, $user = null, $org_id = null, $org = null)
{
$request = $this->getAuthorizationsRequest($zap_trace_span, $user_id, $user, $org_id, $org);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Authorizations';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getAuthorizations'
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $user_id A user ID. Only returns authorizations scoped to this user. (optional)
* @param string $user A user name. Only returns authorizations scoped to this user. (optional)
* @param string $org_id An organization ID. Only returns authorizations that belong to this organization. (optional)
* @param string $org An organization name. Only returns authorizations that belong to this organization. (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getAuthorizationsRequest($zap_trace_span = null, $user_id = null, $user = null, $org_id = null, $org = null)
{
$resourcePath = '/api/v2/authorizations';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($user_id !== null) {
$queryParams['userID'] = ObjectSerializer::toQueryValue($user_id);
}
// query params
if ($user !== null) {
$queryParams['user'] = ObjectSerializer::toQueryValue($user);
}
// query params
if ($org_id !== null) {
$queryParams['orgID'] = ObjectSerializer::toQueryValue($org_id);
}
// query params
if ($org !== null) {
$queryParams['org'] = ObjectSerializer::toQueryValue($org);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getAuthorizationsID
*
* Retrieve an authorization
*
* @param string $auth_id The ID of the authorization to get. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Authorization|string
*/
public function getAuthorizationsID($auth_id, $zap_trace_span = null)
{
list($response) = $this->getAuthorizationsIDWithHttpInfo($auth_id, $zap_trace_span);
return $response;
}
/**
* Operation getAuthorizationsIDWithHttpInfo
*
* Retrieve an authorization
*
* @param string $auth_id The ID of the authorization to get. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Authorization|string, HTTP status code, HTTP response headers (array of strings)
*/
public function getAuthorizationsIDWithHttpInfo($auth_id, $zap_trace_span = null)
{
$request = $this->getAuthorizationsIDRequest($auth_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Authorization';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getAuthorizationsID'
*
* @param string $auth_id The ID of the authorization to get. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getAuthorizationsIDRequest($auth_id, $zap_trace_span = null)
{
// verify the required parameter 'auth_id' is set
if ($auth_id === null || (is_array($auth_id) && count($auth_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $auth_id when calling getAuthorizationsID'
);
}
$resourcePath = '/api/v2/authorizations/{authID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($auth_id !== null) {
$resourcePath = str_replace(
'{' . 'authID' . '}',
ObjectSerializer::toPathValue($auth_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation patchAuthorizationsID
*
* Update an authorization to be active or inactive
*
* @param string $auth_id The ID of the authorization to update. (required)
* @param \InfluxDB2\Model\AuthorizationUpdateRequest $authorization_update_request Authorization to update (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Authorization|string
*/
public function patchAuthorizationsID($auth_id, $authorization_update_request, $zap_trace_span = null)
{
list($response) = $this->patchAuthorizationsIDWithHttpInfo($auth_id, $authorization_update_request, $zap_trace_span);
return $response;
}
/**
* Operation patchAuthorizationsIDWithHttpInfo
*
* Update an authorization to be active or inactive
*
* @param string $auth_id The ID of the authorization to update. (required)
* @param \InfluxDB2\Model\AuthorizationUpdateRequest $authorization_update_request Authorization to update (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Authorization|string, HTTP status code, HTTP response headers (array of strings)
*/
public function patchAuthorizationsIDWithHttpInfo($auth_id, $authorization_update_request, $zap_trace_span = null)
{
$request = $this->patchAuthorizationsIDRequest($auth_id, $authorization_update_request, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Authorization';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'patchAuthorizationsID'
*
* @param string $auth_id The ID of the authorization to update. (required)
* @param \InfluxDB2\Model\AuthorizationUpdateRequest $authorization_update_request Authorization to update (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function patchAuthorizationsIDRequest($auth_id, $authorization_update_request, $zap_trace_span = null)
{
// verify the required parameter 'auth_id' is set
if ($auth_id === null || (is_array($auth_id) && count($auth_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $auth_id when calling patchAuthorizationsID'
);
}
// verify the required parameter 'authorization_update_request' is set
if ($authorization_update_request === null || (is_array($authorization_update_request) && count($authorization_update_request) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $authorization_update_request when calling patchAuthorizationsID'
);
}
$resourcePath = '/api/v2/authorizations/{authID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($auth_id !== null) {
$resourcePath = str_replace(
'{' . 'authID' . '}',
ObjectSerializer::toPathValue($auth_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($authorization_update_request)) {
$_tempBody = $authorization_update_request;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('PATCH', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postAuthorizations
*
* Create an authorization
*
* @param \InfluxDB2\Model\AuthorizationPostRequest $authorization_post_request The authorization to create. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Authorization|string|object|\InfluxDB2\Model\Error|string
*/
public function postAuthorizations($authorization_post_request, $zap_trace_span = null)
{
list($response) = $this->postAuthorizationsWithHttpInfo($authorization_post_request, $zap_trace_span);
return $response;
}
/**
* Operation postAuthorizationsWithHttpInfo
*
* Create an authorization
*
* @param \InfluxDB2\Model\AuthorizationPostRequest $authorization_post_request The authorization to create. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Authorization|string|object|\InfluxDB2\Model\Error|string, HTTP status code, HTTP response headers (array of strings)
*/
public function postAuthorizationsWithHttpInfo($authorization_post_request, $zap_trace_span = null)
{
$request = $this->postAuthorizationsRequest($authorization_post_request, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Authorization';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'postAuthorizations'
*
* @param \InfluxDB2\Model\AuthorizationPostRequest $authorization_post_request The authorization to create. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postAuthorizationsRequest($authorization_post_request, $zap_trace_span = null)
{
// verify the required parameter 'authorization_post_request' is set
if ($authorization_post_request === null || (is_array($authorization_post_request) && count($authorization_post_request) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $authorization_post_request when calling postAuthorizations'
);
}
$resourcePath = '/api/v2/authorizations';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if (isset($authorization_post_request)) {
$_tempBody = $authorization_post_request;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,416 @@
<?php
/**
* BackupService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* BackupService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class BackupService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation getBackupKV
*
* Download snapshot of metadata stored in the server's embedded KV store. Don't use with InfluxDB versions greater than InfluxDB 2.1.x.
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \SplFileObject|string
*/
public function getBackupKV($zap_trace_span = null)
{
list($response) = $this->getBackupKVWithHttpInfo($zap_trace_span);
return $response;
}
/**
* Operation getBackupKVWithHttpInfo
*
* Download snapshot of metadata stored in the server's embedded KV store. Don't use with InfluxDB versions greater than InfluxDB 2.1.x.
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \SplFileObject|string, HTTP status code, HTTP response headers (array of strings)
*/
public function getBackupKVWithHttpInfo($zap_trace_span = null)
{
$request = $this->getBackupKVRequest($zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\SplFileObject';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getBackupKV'
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getBackupKVRequest($zap_trace_span = null)
{
$resourcePath = '/api/v2/backup/kv';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/octet-stream', 'application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/octet-stream', 'application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getBackupMetadata
*
* Download snapshot of all metadata in the server
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $accept_encoding Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to 'identity')
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\MetadataBackup|string
*/
public function getBackupMetadata($zap_trace_span = null, $accept_encoding = 'identity')
{
list($response) = $this->getBackupMetadataWithHttpInfo($zap_trace_span, $accept_encoding);
return $response;
}
/**
* Operation getBackupMetadataWithHttpInfo
*
* Download snapshot of all metadata in the server
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $accept_encoding Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to 'identity')
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\MetadataBackup|string, HTTP status code, HTTP response headers (array of strings)
*/
public function getBackupMetadataWithHttpInfo($zap_trace_span = null, $accept_encoding = 'identity')
{
$request = $this->getBackupMetadataRequest($zap_trace_span, $accept_encoding);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\MetadataBackup';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getBackupMetadata'
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $accept_encoding Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to 'identity')
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getBackupMetadataRequest($zap_trace_span = null, $accept_encoding = 'identity')
{
$resourcePath = '/api/v2/backup/metadata';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// header params
if ($accept_encoding !== null) {
$headerParams['Accept-Encoding'] = ObjectSerializer::toHeaderValue($accept_encoding);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['multipart/mixed', 'application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['multipart/mixed', 'application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getBackupShardId
*
* Download snapshot of all TSM data in a shard
*
* @param int $shard_id The shard ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $accept_encoding Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to 'identity')
* @param \DateTime $since The earliest time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339-timestamp) to include in the snapshot. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \SplFileObject|\InfluxDB2\Model\Error|string
*/
public function getBackupShardId($shard_id, $zap_trace_span = null, $accept_encoding = 'identity', $since = null)
{
list($response) = $this->getBackupShardIdWithHttpInfo($shard_id, $zap_trace_span, $accept_encoding, $since);
return $response;
}
/**
* Operation getBackupShardIdWithHttpInfo
*
* Download snapshot of all TSM data in a shard
*
* @param int $shard_id The shard ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $accept_encoding Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to 'identity')
* @param \DateTime $since The earliest time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339-timestamp) to include in the snapshot. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \SplFileObject|\InfluxDB2\Model\Error|string, HTTP status code, HTTP response headers (array of strings)
*/
public function getBackupShardIdWithHttpInfo($shard_id, $zap_trace_span = null, $accept_encoding = 'identity', $since = null)
{
$request = $this->getBackupShardIdRequest($shard_id, $zap_trace_span, $accept_encoding, $since);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\SplFileObject';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getBackupShardId'
*
* @param int $shard_id The shard ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $accept_encoding Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to 'identity')
* @param \DateTime $since The earliest time [RFC3339 date/time format](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#rfc3339-timestamp) to include in the snapshot. (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getBackupShardIdRequest($shard_id, $zap_trace_span = null, $accept_encoding = 'identity', $since = null)
{
// verify the required parameter 'shard_id' is set
if ($shard_id === null || (is_array($shard_id) && count($shard_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $shard_id when calling getBackupShardId'
);
}
$resourcePath = '/api/v2/backup/shards/{shardID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($since !== null) {
$queryParams['since'] = ObjectSerializer::toQueryValue($since);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// header params
if ($accept_encoding !== null) {
$headerParams['Accept-Encoding'] = ObjectSerializer::toHeaderValue($accept_encoding);
}
// path params
if ($shard_id !== null) {
$resourcePath = str_replace(
'{' . 'shardID' . '}',
ObjectSerializer::toPathValue($shard_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/octet-stream', 'application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/octet-stream', 'application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,895 @@
<?php
/**
* CellsService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* CellsService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class CellsService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation deleteDashboardsIDCellsID
*
* Delete a dashboard cell
*
* @param string $dashboard_id The ID of the dashboard to delete. (required)
* @param string $cell_id The ID of the cell to delete. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function deleteDashboardsIDCellsID($dashboard_id, $cell_id, $zap_trace_span = null)
{
$this->deleteDashboardsIDCellsIDWithHttpInfo($dashboard_id, $cell_id, $zap_trace_span);
}
/**
* Operation deleteDashboardsIDCellsIDWithHttpInfo
*
* Delete a dashboard cell
*
* @param string $dashboard_id The ID of the dashboard to delete. (required)
* @param string $cell_id The ID of the cell to delete. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function deleteDashboardsIDCellsIDWithHttpInfo($dashboard_id, $cell_id, $zap_trace_span = null)
{
$request = $this->deleteDashboardsIDCellsIDRequest($dashboard_id, $cell_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'deleteDashboardsIDCellsID'
*
* @param string $dashboard_id The ID of the dashboard to delete. (required)
* @param string $cell_id The ID of the cell to delete. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function deleteDashboardsIDCellsIDRequest($dashboard_id, $cell_id, $zap_trace_span = null)
{
// verify the required parameter 'dashboard_id' is set
if ($dashboard_id === null || (is_array($dashboard_id) && count($dashboard_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $dashboard_id when calling deleteDashboardsIDCellsID'
);
}
// verify the required parameter 'cell_id' is set
if ($cell_id === null || (is_array($cell_id) && count($cell_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cell_id when calling deleteDashboardsIDCellsID'
);
}
$resourcePath = '/api/v2/dashboards/{dashboardID}/cells/{cellID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($dashboard_id !== null) {
$resourcePath = str_replace(
'{' . 'dashboardID' . '}',
ObjectSerializer::toPathValue($dashboard_id),
$resourcePath
);
}
// path params
if ($cell_id !== null) {
$resourcePath = str_replace(
'{' . 'cellID' . '}',
ObjectSerializer::toPathValue($cell_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('DELETE', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getDashboardsIDCellsIDView
*
* Retrieve the view for a cell
*
* @param string $dashboard_id The dashboard ID. (required)
* @param string $cell_id The cell ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\View|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function getDashboardsIDCellsIDView($dashboard_id, $cell_id, $zap_trace_span = null)
{
list($response) = $this->getDashboardsIDCellsIDViewWithHttpInfo($dashboard_id, $cell_id, $zap_trace_span);
return $response;
}
/**
* Operation getDashboardsIDCellsIDViewWithHttpInfo
*
* Retrieve the view for a cell
*
* @param string $dashboard_id The dashboard ID. (required)
* @param string $cell_id The cell ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\View|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getDashboardsIDCellsIDViewWithHttpInfo($dashboard_id, $cell_id, $zap_trace_span = null)
{
$request = $this->getDashboardsIDCellsIDViewRequest($dashboard_id, $cell_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\View';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getDashboardsIDCellsIDView'
*
* @param string $dashboard_id The dashboard ID. (required)
* @param string $cell_id The cell ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getDashboardsIDCellsIDViewRequest($dashboard_id, $cell_id, $zap_trace_span = null)
{
// verify the required parameter 'dashboard_id' is set
if ($dashboard_id === null || (is_array($dashboard_id) && count($dashboard_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $dashboard_id when calling getDashboardsIDCellsIDView'
);
}
// verify the required parameter 'cell_id' is set
if ($cell_id === null || (is_array($cell_id) && count($cell_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cell_id when calling getDashboardsIDCellsIDView'
);
}
$resourcePath = '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($dashboard_id !== null) {
$resourcePath = str_replace(
'{' . 'dashboardID' . '}',
ObjectSerializer::toPathValue($dashboard_id),
$resourcePath
);
}
// path params
if ($cell_id !== null) {
$resourcePath = str_replace(
'{' . 'cellID' . '}',
ObjectSerializer::toPathValue($cell_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation patchDashboardsIDCellsID
*
* Update the non-positional information related to a cell
*
* @param string $dashboard_id The ID of the dashboard to update. (required)
* @param string $cell_id The ID of the cell to update. (required)
* @param \InfluxDB2\Model\CellUpdate $cell_update cell_update (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Cell|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function patchDashboardsIDCellsID($dashboard_id, $cell_id, $cell_update, $zap_trace_span = null)
{
list($response) = $this->patchDashboardsIDCellsIDWithHttpInfo($dashboard_id, $cell_id, $cell_update, $zap_trace_span);
return $response;
}
/**
* Operation patchDashboardsIDCellsIDWithHttpInfo
*
* Update the non-positional information related to a cell
*
* @param string $dashboard_id The ID of the dashboard to update. (required)
* @param string $cell_id The ID of the cell to update. (required)
* @param \InfluxDB2\Model\CellUpdate $cell_update (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Cell|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function patchDashboardsIDCellsIDWithHttpInfo($dashboard_id, $cell_id, $cell_update, $zap_trace_span = null)
{
$request = $this->patchDashboardsIDCellsIDRequest($dashboard_id, $cell_id, $cell_update, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Cell';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'patchDashboardsIDCellsID'
*
* @param string $dashboard_id The ID of the dashboard to update. (required)
* @param string $cell_id The ID of the cell to update. (required)
* @param \InfluxDB2\Model\CellUpdate $cell_update (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function patchDashboardsIDCellsIDRequest($dashboard_id, $cell_id, $cell_update, $zap_trace_span = null)
{
// verify the required parameter 'dashboard_id' is set
if ($dashboard_id === null || (is_array($dashboard_id) && count($dashboard_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $dashboard_id when calling patchDashboardsIDCellsID'
);
}
// verify the required parameter 'cell_id' is set
if ($cell_id === null || (is_array($cell_id) && count($cell_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cell_id when calling patchDashboardsIDCellsID'
);
}
// verify the required parameter 'cell_update' is set
if ($cell_update === null || (is_array($cell_update) && count($cell_update) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cell_update when calling patchDashboardsIDCellsID'
);
}
$resourcePath = '/api/v2/dashboards/{dashboardID}/cells/{cellID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($dashboard_id !== null) {
$resourcePath = str_replace(
'{' . 'dashboardID' . '}',
ObjectSerializer::toPathValue($dashboard_id),
$resourcePath
);
}
// path params
if ($cell_id !== null) {
$resourcePath = str_replace(
'{' . 'cellID' . '}',
ObjectSerializer::toPathValue($cell_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($cell_update)) {
$_tempBody = $cell_update;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('PATCH', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation patchDashboardsIDCellsIDView
*
* Update the view for a cell
*
* @param string $dashboard_id The ID of the dashboard to update. (required)
* @param string $cell_id The ID of the cell to update. (required)
* @param \InfluxDB2\Model\View $view view (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\View|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function patchDashboardsIDCellsIDView($dashboard_id, $cell_id, $view, $zap_trace_span = null)
{
list($response) = $this->patchDashboardsIDCellsIDViewWithHttpInfo($dashboard_id, $cell_id, $view, $zap_trace_span);
return $response;
}
/**
* Operation patchDashboardsIDCellsIDViewWithHttpInfo
*
* Update the view for a cell
*
* @param string $dashboard_id The ID of the dashboard to update. (required)
* @param string $cell_id The ID of the cell to update. (required)
* @param \InfluxDB2\Model\View $view (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\View|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function patchDashboardsIDCellsIDViewWithHttpInfo($dashboard_id, $cell_id, $view, $zap_trace_span = null)
{
$request = $this->patchDashboardsIDCellsIDViewRequest($dashboard_id, $cell_id, $view, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\View';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'patchDashboardsIDCellsIDView'
*
* @param string $dashboard_id The ID of the dashboard to update. (required)
* @param string $cell_id The ID of the cell to update. (required)
* @param \InfluxDB2\Model\View $view (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function patchDashboardsIDCellsIDViewRequest($dashboard_id, $cell_id, $view, $zap_trace_span = null)
{
// verify the required parameter 'dashboard_id' is set
if ($dashboard_id === null || (is_array($dashboard_id) && count($dashboard_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $dashboard_id when calling patchDashboardsIDCellsIDView'
);
}
// verify the required parameter 'cell_id' is set
if ($cell_id === null || (is_array($cell_id) && count($cell_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cell_id when calling patchDashboardsIDCellsIDView'
);
}
// verify the required parameter 'view' is set
if ($view === null || (is_array($view) && count($view) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $view when calling patchDashboardsIDCellsIDView'
);
}
$resourcePath = '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($dashboard_id !== null) {
$resourcePath = str_replace(
'{' . 'dashboardID' . '}',
ObjectSerializer::toPathValue($dashboard_id),
$resourcePath
);
}
// path params
if ($cell_id !== null) {
$resourcePath = str_replace(
'{' . 'cellID' . '}',
ObjectSerializer::toPathValue($cell_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($view)) {
$_tempBody = $view;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('PATCH', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postDashboardsIDCells
*
* Create a dashboard cell
*
* @param string $dashboard_id The ID of the dashboard to update. (required)
* @param \InfluxDB2\Model\CreateCell $create_cell Cell that will be added (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Cell|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function postDashboardsIDCells($dashboard_id, $create_cell, $zap_trace_span = null)
{
list($response) = $this->postDashboardsIDCellsWithHttpInfo($dashboard_id, $create_cell, $zap_trace_span);
return $response;
}
/**
* Operation postDashboardsIDCellsWithHttpInfo
*
* Create a dashboard cell
*
* @param string $dashboard_id The ID of the dashboard to update. (required)
* @param \InfluxDB2\Model\CreateCell $create_cell Cell that will be added (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Cell|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function postDashboardsIDCellsWithHttpInfo($dashboard_id, $create_cell, $zap_trace_span = null)
{
$request = $this->postDashboardsIDCellsRequest($dashboard_id, $create_cell, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Cell';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'postDashboardsIDCells'
*
* @param string $dashboard_id The ID of the dashboard to update. (required)
* @param \InfluxDB2\Model\CreateCell $create_cell Cell that will be added (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postDashboardsIDCellsRequest($dashboard_id, $create_cell, $zap_trace_span = null)
{
// verify the required parameter 'dashboard_id' is set
if ($dashboard_id === null || (is_array($dashboard_id) && count($dashboard_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $dashboard_id when calling postDashboardsIDCells'
);
}
// verify the required parameter 'create_cell' is set
if ($create_cell === null || (is_array($create_cell) && count($create_cell) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $create_cell when calling postDashboardsIDCells'
);
}
$resourcePath = '/api/v2/dashboards/{dashboardID}/cells';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($dashboard_id !== null) {
$resourcePath = str_replace(
'{' . 'dashboardID' . '}',
ObjectSerializer::toPathValue($dashboard_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($create_cell)) {
$_tempBody = $create_cell;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation putDashboardsIDCells
*
* Replace cells in a dashboard
*
* @param string $dashboard_id The ID of the dashboard to update. (required)
* @param \InfluxDB2\Model\Cell[] $cell cell (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Dashboard|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function putDashboardsIDCells($dashboard_id, $cell, $zap_trace_span = null)
{
list($response) = $this->putDashboardsIDCellsWithHttpInfo($dashboard_id, $cell, $zap_trace_span);
return $response;
}
/**
* Operation putDashboardsIDCellsWithHttpInfo
*
* Replace cells in a dashboard
*
* @param string $dashboard_id The ID of the dashboard to update. (required)
* @param \InfluxDB2\Model\Cell[] $cell (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Dashboard|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function putDashboardsIDCellsWithHttpInfo($dashboard_id, $cell, $zap_trace_span = null)
{
$request = $this->putDashboardsIDCellsRequest($dashboard_id, $cell, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Dashboard';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'putDashboardsIDCells'
*
* @param string $dashboard_id The ID of the dashboard to update. (required)
* @param \InfluxDB2\Model\Cell[] $cell (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function putDashboardsIDCellsRequest($dashboard_id, $cell, $zap_trace_span = null)
{
// verify the required parameter 'dashboard_id' is set
if ($dashboard_id === null || (is_array($dashboard_id) && count($dashboard_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $dashboard_id when calling putDashboardsIDCells'
);
}
// verify the required parameter 'cell' is set
if ($cell === null || (is_array($cell) && count($cell) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cell when calling putDashboardsIDCells'
);
}
$resourcePath = '/api/v2/dashboards/{dashboardID}/cells';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($dashboard_id !== null) {
$resourcePath = str_replace(
'{' . 'dashboardID' . '}',
ObjectSerializer::toPathValue($dashboard_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($cell)) {
$_tempBody = $cell;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('PUT', $resourcePath, $httpBody, $headers, $queryParams);
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,170 @@
<?php
/**
* ConfigService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* ConfigService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class ConfigService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation getConfig
*
* Retrieve runtime configuration
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Config|string|string
*/
public function getConfig($zap_trace_span = null)
{
list($response) = $this->getConfigWithHttpInfo($zap_trace_span);
return $response;
}
/**
* Operation getConfigWithHttpInfo
*
* Retrieve runtime configuration
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Config|string|string, HTTP status code, HTTP response headers (array of strings)
*/
public function getConfigWithHttpInfo($zap_trace_span = null)
{
$request = $this->getConfigRequest($zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Config';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getConfig'
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getConfigRequest($zap_trace_span = null)
{
$resourcePath = '/api/v2/config';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,739 @@
<?php
/**
* DBRPsService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* DBRPsService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class DBRPsService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation deleteDBRPID
*
* Delete a database retention policy
*
* @param string $dbrp_id The database retention policy mapping (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org_id Specifies the organization ID of the mapping (optional)
* @param string $org Specifies the organization name of the mapping (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function deleteDBRPID($dbrp_id, $zap_trace_span = null, $org_id = null, $org = null)
{
$this->deleteDBRPIDWithHttpInfo($dbrp_id, $zap_trace_span, $org_id, $org);
}
/**
* Operation deleteDBRPIDWithHttpInfo
*
* Delete a database retention policy
*
* @param string $dbrp_id The database retention policy mapping (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org_id Specifies the organization ID of the mapping (optional)
* @param string $org Specifies the organization name of the mapping (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function deleteDBRPIDWithHttpInfo($dbrp_id, $zap_trace_span = null, $org_id = null, $org = null)
{
$request = $this->deleteDBRPIDRequest($dbrp_id, $zap_trace_span, $org_id, $org);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'deleteDBRPID'
*
* @param string $dbrp_id The database retention policy mapping (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org_id Specifies the organization ID of the mapping (optional)
* @param string $org Specifies the organization name of the mapping (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function deleteDBRPIDRequest($dbrp_id, $zap_trace_span = null, $org_id = null, $org = null)
{
// verify the required parameter 'dbrp_id' is set
if ($dbrp_id === null || (is_array($dbrp_id) && count($dbrp_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $dbrp_id when calling deleteDBRPID'
);
}
$resourcePath = '/api/v2/dbrps/{dbrpID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($org_id !== null) {
$queryParams['orgID'] = ObjectSerializer::toQueryValue($org_id);
}
// query params
if ($org !== null) {
$queryParams['org'] = ObjectSerializer::toQueryValue($org);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($dbrp_id !== null) {
$resourcePath = str_replace(
'{' . 'dbrpID' . '}',
ObjectSerializer::toPathValue($dbrp_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('DELETE', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getDBRPs
*
* List database retention policy mappings
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org_id Specifies the organization ID to filter on (optional)
* @param string $org Specifies the organization name to filter on (optional)
* @param string $id Specifies the mapping ID to filter on (optional)
* @param string $bucket_id Specifies the bucket ID to filter on (optional)
* @param bool $default Specifies filtering on default (optional)
* @param string $db Specifies the database to filter on (optional)
* @param string $rp Specifies the retention policy to filter on (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\DBRPs|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function getDBRPs($zap_trace_span = null, $org_id = null, $org = null, $id = null, $bucket_id = null, $default = null, $db = null, $rp = null)
{
list($response) = $this->getDBRPsWithHttpInfo($zap_trace_span, $org_id, $org, $id, $bucket_id, $default, $db, $rp);
return $response;
}
/**
* Operation getDBRPsWithHttpInfo
*
* List database retention policy mappings
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org_id Specifies the organization ID to filter on (optional)
* @param string $org Specifies the organization name to filter on (optional)
* @param string $id Specifies the mapping ID to filter on (optional)
* @param string $bucket_id Specifies the bucket ID to filter on (optional)
* @param bool $default Specifies filtering on default (optional)
* @param string $db Specifies the database to filter on (optional)
* @param string $rp Specifies the retention policy to filter on (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\DBRPs|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getDBRPsWithHttpInfo($zap_trace_span = null, $org_id = null, $org = null, $id = null, $bucket_id = null, $default = null, $db = null, $rp = null)
{
$request = $this->getDBRPsRequest($zap_trace_span, $org_id, $org, $id, $bucket_id, $default, $db, $rp);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\DBRPs';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getDBRPs'
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org_id Specifies the organization ID to filter on (optional)
* @param string $org Specifies the organization name to filter on (optional)
* @param string $id Specifies the mapping ID to filter on (optional)
* @param string $bucket_id Specifies the bucket ID to filter on (optional)
* @param bool $default Specifies filtering on default (optional)
* @param string $db Specifies the database to filter on (optional)
* @param string $rp Specifies the retention policy to filter on (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getDBRPsRequest($zap_trace_span = null, $org_id = null, $org = null, $id = null, $bucket_id = null, $default = null, $db = null, $rp = null)
{
$resourcePath = '/api/v2/dbrps';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($org_id !== null) {
$queryParams['orgID'] = ObjectSerializer::toQueryValue($org_id);
}
// query params
if ($org !== null) {
$queryParams['org'] = ObjectSerializer::toQueryValue($org);
}
// query params
if ($id !== null) {
$queryParams['id'] = ObjectSerializer::toQueryValue($id);
}
// query params
if ($bucket_id !== null) {
$queryParams['bucketID'] = ObjectSerializer::toQueryValue($bucket_id);
}
// query params
if ($default !== null) {
$queryParams['default'] = ObjectSerializer::toQueryValue($default);
}
// query params
if ($db !== null) {
$queryParams['db'] = ObjectSerializer::toQueryValue($db);
}
// query params
if ($rp !== null) {
$queryParams['rp'] = ObjectSerializer::toQueryValue($rp);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getDBRPsID
*
* Retrieve a database retention policy mapping
*
* @param string $dbrp_id The database retention policy mapping ID (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org_id Specifies the organization ID of the mapping (optional)
* @param string $org Specifies the organization name of the mapping (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\DBRPGet|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function getDBRPsID($dbrp_id, $zap_trace_span = null, $org_id = null, $org = null)
{
list($response) = $this->getDBRPsIDWithHttpInfo($dbrp_id, $zap_trace_span, $org_id, $org);
return $response;
}
/**
* Operation getDBRPsIDWithHttpInfo
*
* Retrieve a database retention policy mapping
*
* @param string $dbrp_id The database retention policy mapping ID (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org_id Specifies the organization ID of the mapping (optional)
* @param string $org Specifies the organization name of the mapping (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\DBRPGet|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getDBRPsIDWithHttpInfo($dbrp_id, $zap_trace_span = null, $org_id = null, $org = null)
{
$request = $this->getDBRPsIDRequest($dbrp_id, $zap_trace_span, $org_id, $org);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\DBRPGet';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getDBRPsID'
*
* @param string $dbrp_id The database retention policy mapping ID (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org_id Specifies the organization ID of the mapping (optional)
* @param string $org Specifies the organization name of the mapping (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getDBRPsIDRequest($dbrp_id, $zap_trace_span = null, $org_id = null, $org = null)
{
// verify the required parameter 'dbrp_id' is set
if ($dbrp_id === null || (is_array($dbrp_id) && count($dbrp_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $dbrp_id when calling getDBRPsID'
);
}
$resourcePath = '/api/v2/dbrps/{dbrpID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($org_id !== null) {
$queryParams['orgID'] = ObjectSerializer::toQueryValue($org_id);
}
// query params
if ($org !== null) {
$queryParams['org'] = ObjectSerializer::toQueryValue($org);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($dbrp_id !== null) {
$resourcePath = str_replace(
'{' . 'dbrpID' . '}',
ObjectSerializer::toPathValue($dbrp_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation patchDBRPID
*
* Update a database retention policy mapping
*
* @param string $dbrp_id The database retention policy mapping. (required)
* @param \InfluxDB2\Model\DBRPUpdate $dbrp_update Database retention policy update to apply (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org_id Specifies the organization ID of the mapping (optional)
* @param string $org Specifies the organization name of the mapping (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\DBRPGet|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function patchDBRPID($dbrp_id, $dbrp_update, $zap_trace_span = null, $org_id = null, $org = null)
{
list($response) = $this->patchDBRPIDWithHttpInfo($dbrp_id, $dbrp_update, $zap_trace_span, $org_id, $org);
return $response;
}
/**
* Operation patchDBRPIDWithHttpInfo
*
* Update a database retention policy mapping
*
* @param string $dbrp_id The database retention policy mapping. (required)
* @param \InfluxDB2\Model\DBRPUpdate $dbrp_update Database retention policy update to apply (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org_id Specifies the organization ID of the mapping (optional)
* @param string $org Specifies the organization name of the mapping (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\DBRPGet|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function patchDBRPIDWithHttpInfo($dbrp_id, $dbrp_update, $zap_trace_span = null, $org_id = null, $org = null)
{
$request = $this->patchDBRPIDRequest($dbrp_id, $dbrp_update, $zap_trace_span, $org_id, $org);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\DBRPGet';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'patchDBRPID'
*
* @param string $dbrp_id The database retention policy mapping. (required)
* @param \InfluxDB2\Model\DBRPUpdate $dbrp_update Database retention policy update to apply (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org_id Specifies the organization ID of the mapping (optional)
* @param string $org Specifies the organization name of the mapping (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function patchDBRPIDRequest($dbrp_id, $dbrp_update, $zap_trace_span = null, $org_id = null, $org = null)
{
// verify the required parameter 'dbrp_id' is set
if ($dbrp_id === null || (is_array($dbrp_id) && count($dbrp_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $dbrp_id when calling patchDBRPID'
);
}
// verify the required parameter 'dbrp_update' is set
if ($dbrp_update === null || (is_array($dbrp_update) && count($dbrp_update) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $dbrp_update when calling patchDBRPID'
);
}
$resourcePath = '/api/v2/dbrps/{dbrpID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($org_id !== null) {
$queryParams['orgID'] = ObjectSerializer::toQueryValue($org_id);
}
// query params
if ($org !== null) {
$queryParams['org'] = ObjectSerializer::toQueryValue($org);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($dbrp_id !== null) {
$resourcePath = str_replace(
'{' . 'dbrpID' . '}',
ObjectSerializer::toPathValue($dbrp_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($dbrp_update)) {
$_tempBody = $dbrp_update;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('PATCH', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postDBRP
*
* Add a database retention policy mapping
*
* @param \InfluxDB2\Model\DBRPCreate $dbrp_create The database retention policy mapping to add (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\DBRP|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function postDBRP($dbrp_create, $zap_trace_span = null)
{
list($response) = $this->postDBRPWithHttpInfo($dbrp_create, $zap_trace_span);
return $response;
}
/**
* Operation postDBRPWithHttpInfo
*
* Add a database retention policy mapping
*
* @param \InfluxDB2\Model\DBRPCreate $dbrp_create The database retention policy mapping to add (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\DBRP|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function postDBRPWithHttpInfo($dbrp_create, $zap_trace_span = null)
{
$request = $this->postDBRPRequest($dbrp_create, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\DBRP';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'postDBRP'
*
* @param \InfluxDB2\Model\DBRPCreate $dbrp_create The database retention policy mapping to add (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postDBRPRequest($dbrp_create, $zap_trace_span = null)
{
// verify the required parameter 'dbrp_create' is set
if ($dbrp_create === null || (is_array($dbrp_create) && count($dbrp_create) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $dbrp_create when calling postDBRP'
);
}
$resourcePath = '/api/v2/dbrps';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if (isset($dbrp_create)) {
$_tempBody = $dbrp_create;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,197 @@
<?php
/**
* DeleteService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* DeleteService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class DeleteService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation postDelete
*
* Delete data
*
* @param \InfluxDB2\Model\DeletePredicateRequest $delete_predicate_request Time range parameters and an optional **delete predicate expression**. To select points to delete within the specified time range, pass a **delete predicate expression** in the &#x60;predicate&#x60; property of the request body. If you don&#39;t pass a &#x60;predicate&#x60;, InfluxDB deletes all data with timestamps in the specified time range. #### Related guides - [Delete data](https://docs.influxdata.com/influxdb/v2.3/write-data/delete-data/). - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/v2.3/reference/syntax/delete-predicate/). (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org The organization to delete data from. If you pass both &#x60;orgID&#x60; and &#x60;org&#x60;, they must both be valid. #### InfluxDB Cloud - Doesn&#39;t require &#x60;org&#x60; or &#x60;orgID&#x60;. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. (optional)
* @param string $bucket The name or ID of the bucket to delete data from. If you pass both &#x60;bucket&#x60; and &#x60;bucketID&#x60;, &#x60;bucketID&#x60; takes precedence. (optional)
* @param string $org_id The ID of the organization to delete data from. If you pass both &#x60;orgID&#x60; and &#x60;org&#x60;, they must both be valid. #### InfluxDB Cloud - Doesn&#39;t require &#x60;org&#x60; or &#x60;orgID&#x60;. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. (optional)
* @param string $bucket_id The ID of the bucket to delete data from. If you pass both &#x60;bucket&#x60; and &#x60;bucketID&#x60;, &#x60;bucketID&#x60; takes precedence. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function postDelete($delete_predicate_request, $zap_trace_span = null, $org = null, $bucket = null, $org_id = null, $bucket_id = null)
{
$this->postDeleteWithHttpInfo($delete_predicate_request, $zap_trace_span, $org, $bucket, $org_id, $bucket_id);
}
/**
* Operation postDeleteWithHttpInfo
*
* Delete data
*
* @param \InfluxDB2\Model\DeletePredicateRequest $delete_predicate_request Time range parameters and an optional **delete predicate expression**. To select points to delete within the specified time range, pass a **delete predicate expression** in the &#x60;predicate&#x60; property of the request body. If you don&#39;t pass a &#x60;predicate&#x60;, InfluxDB deletes all data with timestamps in the specified time range. #### Related guides - [Delete data](https://docs.influxdata.com/influxdb/v2.3/write-data/delete-data/). - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/v2.3/reference/syntax/delete-predicate/). (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org The organization to delete data from. If you pass both &#x60;orgID&#x60; and &#x60;org&#x60;, they must both be valid. #### InfluxDB Cloud - Doesn&#39;t require &#x60;org&#x60; or &#x60;orgID&#x60;. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. (optional)
* @param string $bucket The name or ID of the bucket to delete data from. If you pass both &#x60;bucket&#x60; and &#x60;bucketID&#x60;, &#x60;bucketID&#x60; takes precedence. (optional)
* @param string $org_id The ID of the organization to delete data from. If you pass both &#x60;orgID&#x60; and &#x60;org&#x60;, they must both be valid. #### InfluxDB Cloud - Doesn&#39;t require &#x60;org&#x60; or &#x60;orgID&#x60;. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. (optional)
* @param string $bucket_id The ID of the bucket to delete data from. If you pass both &#x60;bucket&#x60; and &#x60;bucketID&#x60;, &#x60;bucketID&#x60; takes precedence. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function postDeleteWithHttpInfo($delete_predicate_request, $zap_trace_span = null, $org = null, $bucket = null, $org_id = null, $bucket_id = null)
{
$request = $this->postDeleteRequest($delete_predicate_request, $zap_trace_span, $org, $bucket, $org_id, $bucket_id);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'postDelete'
*
* @param \InfluxDB2\Model\DeletePredicateRequest $delete_predicate_request Time range parameters and an optional **delete predicate expression**. To select points to delete within the specified time range, pass a **delete predicate expression** in the &#x60;predicate&#x60; property of the request body. If you don&#39;t pass a &#x60;predicate&#x60;, InfluxDB deletes all data with timestamps in the specified time range. #### Related guides - [Delete data](https://docs.influxdata.com/influxdb/v2.3/write-data/delete-data/). - Learn how to use [delete predicate syntax](https://docs.influxdata.com/influxdb/v2.3/reference/syntax/delete-predicate/). (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org The organization to delete data from. If you pass both &#x60;orgID&#x60; and &#x60;org&#x60;, they must both be valid. #### InfluxDB Cloud - Doesn&#39;t require &#x60;org&#x60; or &#x60;orgID&#x60;. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. (optional)
* @param string $bucket The name or ID of the bucket to delete data from. If you pass both &#x60;bucket&#x60; and &#x60;bucketID&#x60;, &#x60;bucketID&#x60; takes precedence. (optional)
* @param string $org_id The ID of the organization to delete data from. If you pass both &#x60;orgID&#x60; and &#x60;org&#x60;, they must both be valid. #### InfluxDB Cloud - Doesn&#39;t require &#x60;org&#x60; or &#x60;orgID&#x60;. - Deletes data from the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. (optional)
* @param string $bucket_id The ID of the bucket to delete data from. If you pass both &#x60;bucket&#x60; and &#x60;bucketID&#x60;, &#x60;bucketID&#x60; takes precedence. (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postDeleteRequest($delete_predicate_request, $zap_trace_span = null, $org = null, $bucket = null, $org_id = null, $bucket_id = null)
{
// verify the required parameter 'delete_predicate_request' is set
if ($delete_predicate_request === null || (is_array($delete_predicate_request) && count($delete_predicate_request) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $delete_predicate_request when calling postDelete'
);
}
$resourcePath = '/api/v2/delete';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($org !== null) {
$queryParams['org'] = ObjectSerializer::toQueryValue($org);
}
// query params
if ($bucket !== null) {
$queryParams['bucket'] = ObjectSerializer::toQueryValue($bucket);
}
// query params
if ($org_id !== null) {
$queryParams['orgID'] = ObjectSerializer::toQueryValue($org_id);
}
// query params
if ($bucket_id !== null) {
$queryParams['bucketID'] = ObjectSerializer::toQueryValue($bucket_id);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if (isset($delete_predicate_request)) {
$_tempBody = $delete_predicate_request;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,170 @@
<?php
/**
* HealthService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* HealthService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class HealthService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation getHealth
*
* Retrieve the health of the instance
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\HealthCheck|\InfluxDB2\Model\HealthCheck|string
*/
public function getHealth($zap_trace_span = null)
{
list($response) = $this->getHealthWithHttpInfo($zap_trace_span);
return $response;
}
/**
* Operation getHealthWithHttpInfo
*
* Retrieve the health of the instance
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\HealthCheck|\InfluxDB2\Model\HealthCheck|string, HTTP status code, HTTP response headers (array of strings)
*/
public function getHealthWithHttpInfo($zap_trace_span = null)
{
$request = $this->getHealthRequest($zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\HealthCheck';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getHealth'
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getHealthRequest($zap_trace_span = null)
{
$resourcePath = '/health';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,648 @@
<?php
/**
* LabelsService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* LabelsService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class LabelsService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation deleteLabelsID
*
* Delete a label
*
* @param string $label_id The ID of the label to delete. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function deleteLabelsID($label_id, $zap_trace_span = null)
{
$this->deleteLabelsIDWithHttpInfo($label_id, $zap_trace_span);
}
/**
* Operation deleteLabelsIDWithHttpInfo
*
* Delete a label
*
* @param string $label_id The ID of the label to delete. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function deleteLabelsIDWithHttpInfo($label_id, $zap_trace_span = null)
{
$request = $this->deleteLabelsIDRequest($label_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'deleteLabelsID'
*
* @param string $label_id The ID of the label to delete. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function deleteLabelsIDRequest($label_id, $zap_trace_span = null)
{
// verify the required parameter 'label_id' is set
if ($label_id === null || (is_array($label_id) && count($label_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $label_id when calling deleteLabelsID'
);
}
$resourcePath = '/api/v2/labels/{labelID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($label_id !== null) {
$resourcePath = str_replace(
'{' . 'labelID' . '}',
ObjectSerializer::toPathValue($label_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('DELETE', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getLabels
*
* List all labels
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org_id The organization ID. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\LabelsResponse|\InfluxDB2\Model\Error|string
*/
public function getLabels($zap_trace_span = null, $org_id = null)
{
list($response) = $this->getLabelsWithHttpInfo($zap_trace_span, $org_id);
return $response;
}
/**
* Operation getLabelsWithHttpInfo
*
* List all labels
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org_id The organization ID. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\LabelsResponse|\InfluxDB2\Model\Error|string, HTTP status code, HTTP response headers (array of strings)
*/
public function getLabelsWithHttpInfo($zap_trace_span = null, $org_id = null)
{
$request = $this->getLabelsRequest($zap_trace_span, $org_id);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\LabelsResponse';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getLabels'
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org_id The organization ID. (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getLabelsRequest($zap_trace_span = null, $org_id = null)
{
$resourcePath = '/api/v2/labels';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($org_id !== null) {
$queryParams['orgID'] = ObjectSerializer::toQueryValue($org_id);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getLabelsID
*
* Retrieve a label
*
* @param string $label_id The ID of the label to update. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\LabelResponse|\InfluxDB2\Model\Error|string
*/
public function getLabelsID($label_id, $zap_trace_span = null)
{
list($response) = $this->getLabelsIDWithHttpInfo($label_id, $zap_trace_span);
return $response;
}
/**
* Operation getLabelsIDWithHttpInfo
*
* Retrieve a label
*
* @param string $label_id The ID of the label to update. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\LabelResponse|\InfluxDB2\Model\Error|string, HTTP status code, HTTP response headers (array of strings)
*/
public function getLabelsIDWithHttpInfo($label_id, $zap_trace_span = null)
{
$request = $this->getLabelsIDRequest($label_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\LabelResponse';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getLabelsID'
*
* @param string $label_id The ID of the label to update. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getLabelsIDRequest($label_id, $zap_trace_span = null)
{
// verify the required parameter 'label_id' is set
if ($label_id === null || (is_array($label_id) && count($label_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $label_id when calling getLabelsID'
);
}
$resourcePath = '/api/v2/labels/{labelID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($label_id !== null) {
$resourcePath = str_replace(
'{' . 'labelID' . '}',
ObjectSerializer::toPathValue($label_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation patchLabelsID
*
* Update a label
*
* @param string $label_id The ID of the label to update. (required)
* @param \InfluxDB2\Model\LabelUpdate $label_update A label update. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\LabelResponse|object|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error|string
*/
public function patchLabelsID($label_id, $label_update, $zap_trace_span = null)
{
list($response) = $this->patchLabelsIDWithHttpInfo($label_id, $label_update, $zap_trace_span);
return $response;
}
/**
* Operation patchLabelsIDWithHttpInfo
*
* Update a label
*
* @param string $label_id The ID of the label to update. (required)
* @param \InfluxDB2\Model\LabelUpdate $label_update A label update. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\LabelResponse|object|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error|string, HTTP status code, HTTP response headers (array of strings)
*/
public function patchLabelsIDWithHttpInfo($label_id, $label_update, $zap_trace_span = null)
{
$request = $this->patchLabelsIDRequest($label_id, $label_update, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\LabelResponse';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'patchLabelsID'
*
* @param string $label_id The ID of the label to update. (required)
* @param \InfluxDB2\Model\LabelUpdate $label_update A label update. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function patchLabelsIDRequest($label_id, $label_update, $zap_trace_span = null)
{
// verify the required parameter 'label_id' is set
if ($label_id === null || (is_array($label_id) && count($label_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $label_id when calling patchLabelsID'
);
}
// verify the required parameter 'label_update' is set
if ($label_update === null || (is_array($label_update) && count($label_update) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $label_update when calling patchLabelsID'
);
}
$resourcePath = '/api/v2/labels/{labelID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($label_id !== null) {
$resourcePath = str_replace(
'{' . 'labelID' . '}',
ObjectSerializer::toPathValue($label_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($label_update)) {
$_tempBody = $label_update;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('PATCH', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postLabels
*
* Create a label
*
* @param \InfluxDB2\Model\LabelCreateRequest $label_create_request The label to create. (required)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\LabelResponse|\InfluxDB2\Model\Error|string
*/
public function postLabels($label_create_request)
{
list($response) = $this->postLabelsWithHttpInfo($label_create_request);
return $response;
}
/**
* Operation postLabelsWithHttpInfo
*
* Create a label
*
* @param \InfluxDB2\Model\LabelCreateRequest $label_create_request The label to create. (required)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\LabelResponse|\InfluxDB2\Model\Error|string, HTTP status code, HTTP response headers (array of strings)
*/
public function postLabelsWithHttpInfo($label_create_request)
{
$request = $this->postLabelsRequest($label_create_request);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\LabelResponse';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'postLabels'
*
* @param \InfluxDB2\Model\LabelCreateRequest $label_create_request The label to create. (required)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postLabelsRequest($label_create_request)
{
// verify the required parameter 'label_create_request' is set
if ($label_create_request === null || (is_array($label_create_request) && count($label_create_request) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $label_create_request when calling postLabels'
);
}
$resourcePath = '/api/v2/labels';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// body params
$_tempBody = null;
if (isset($label_create_request)) {
$_tempBody = $label_create_request;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,170 @@
<?php
/**
* MetricsService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* MetricsService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class MetricsService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation getMetrics
*
* Retrieve workload performance metrics
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return string|string
*/
public function getMetrics($zap_trace_span = null)
{
list($response) = $this->getMetricsWithHttpInfo($zap_trace_span);
return $response;
}
/**
* Operation getMetricsWithHttpInfo
*
* Retrieve workload performance metrics
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of string|string, HTTP status code, HTTP response headers (array of strings)
*/
public function getMetricsWithHttpInfo($zap_trace_span = null)
{
$request = $this->getMetricsRequest($zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = 'string';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getMetrics'
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getMetricsRequest($zap_trace_span = null)
{
$resourcePath = '/metrics';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['text/plain', 'application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['text/plain', 'application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,234 @@
<?php
/**
* PingService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* PingService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class PingService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation getPing
*
* Get the status of the instance
*
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function getPing()
{
$this->getPingWithHttpInfo();
}
/**
* Operation getPingWithHttpInfo
*
* Get the status of the instance
*
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function getPingWithHttpInfo()
{
$request = $this->getPingRequest();
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'getPing'
*
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getPingRequest()
{
$resourcePath = '/ping';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
[]
);
} else {
$headers = $this->headerSelector->selectHeaders(
[],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation headPing
*
* Get the status of the instance
*
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function headPing()
{
$this->headPingWithHttpInfo();
}
/**
* Operation headPingWithHttpInfo
*
* Get the status of the instance
*
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function headPingWithHttpInfo()
{
$request = $this->headPingRequest();
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'headPing'
*
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function headPingRequest()
{
$resourcePath = '/ping';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
[]
);
} else {
$headers = $this->headerSelector->selectHeaders(
[],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('HEAD', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,663 @@
<?php
/**
* QueryService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* QueryService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class QueryService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation getQuerySuggestions
*
* Retrieve Flux query suggestions
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\FluxSuggestions|object|\InfluxDB2\Model\Error
*/
public function getQuerySuggestions($zap_trace_span = null)
{
list($response) = $this->getQuerySuggestionsWithHttpInfo($zap_trace_span);
return $response;
}
/**
* Operation getQuerySuggestionsWithHttpInfo
*
* Retrieve Flux query suggestions
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\FluxSuggestions|object|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getQuerySuggestionsWithHttpInfo($zap_trace_span = null)
{
$request = $this->getQuerySuggestionsRequest($zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\FluxSuggestions';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getQuerySuggestions'
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getQuerySuggestionsRequest($zap_trace_span = null)
{
$resourcePath = '/api/v2/query/suggestions';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json', 'text/html']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json', 'text/html'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getQuerySuggestionsName
*
* Retrieve a query suggestion for a branching suggestion
*
* @param string $name A Flux Function name. Only returns functions with this name. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\FluxSuggestion|\InfluxDB2\Model\Error
*/
public function getQuerySuggestionsName($name, $zap_trace_span = null)
{
list($response) = $this->getQuerySuggestionsNameWithHttpInfo($name, $zap_trace_span);
return $response;
}
/**
* Operation getQuerySuggestionsNameWithHttpInfo
*
* Retrieve a query suggestion for a branching suggestion
*
* @param string $name A Flux Function name. Only returns functions with this name. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\FluxSuggestion|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getQuerySuggestionsNameWithHttpInfo($name, $zap_trace_span = null)
{
$request = $this->getQuerySuggestionsNameRequest($name, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\FluxSuggestion';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getQuerySuggestionsName'
*
* @param string $name A Flux Function name. Only returns functions with this name. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getQuerySuggestionsNameRequest($name, $zap_trace_span = null)
{
// verify the required parameter 'name' is set
if ($name === null || (is_array($name) && count($name) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $name when calling getQuerySuggestionsName'
);
}
$resourcePath = '/api/v2/query/suggestions/{name}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($name !== null) {
$resourcePath = str_replace(
'{' . 'name' . '}',
ObjectSerializer::toPathValue($name),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postQuery
*
* Query data
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $accept_encoding The content encoding (usually a compression algorithm) that the client can understand. (optional, default to 'identity')
* @param string $content_type content_type (optional)
* @param string $org The name or ID of the organization executing the query. #### InfluxDB Cloud - Doesn&#39;t use &#x60;org&#x60; or &#x60;orgID&#x60;. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. (optional)
* @param string $org_id The ID of the organization executing the query. #### InfluxDB Cloud - Doesn&#39;t use &#x60;org&#x60; or &#x60;orgID&#x60;. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. (optional)
* @param \InfluxDB2\Model\Query $query Flux query or specification to execute (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return string|\InfluxDB2\Model\Error|object|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error|string
*/
public function postQuery($zap_trace_span = null, $accept_encoding = 'identity', $content_type = null, $org = null, $org_id = null, $query = null)
{
list($response) = $this->postQueryWithHttpInfo($zap_trace_span, $accept_encoding, $content_type, $org, $org_id, $query);
return $response;
}
/**
* Operation postQueryWithHttpInfo
*
* Query data
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $accept_encoding The content encoding (usually a compression algorithm) that the client can understand. (optional, default to 'identity')
* @param string $content_type (optional)
* @param string $org The name or ID of the organization executing the query. #### InfluxDB Cloud - Doesn&#39;t use &#x60;org&#x60; or &#x60;orgID&#x60;. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. (optional)
* @param string $org_id The ID of the organization executing the query. #### InfluxDB Cloud - Doesn&#39;t use &#x60;org&#x60; or &#x60;orgID&#x60;. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. (optional)
* @param \InfluxDB2\Model\Query $query Flux query or specification to execute (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of string|\InfluxDB2\Model\Error|object|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error|string, HTTP status code, HTTP response headers (array of strings)
*/
public function postQueryWithHttpInfo($zap_trace_span = null, $accept_encoding = 'identity', $content_type = null, $org = null, $org_id = null, $query = null)
{
$request = $this->postQueryRequest($zap_trace_span, $accept_encoding, $content_type, $org, $org_id, $query);
$response = $this->defaultApi->sendRequest($request);
$returnType = 'string';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'postQuery'
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $accept_encoding The content encoding (usually a compression algorithm) that the client can understand. (optional, default to 'identity')
* @param string $content_type (optional)
* @param string $org The name or ID of the organization executing the query. #### InfluxDB Cloud - Doesn&#39;t use &#x60;org&#x60; or &#x60;orgID&#x60;. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. (optional)
* @param string $org_id The ID of the organization executing the query. #### InfluxDB Cloud - Doesn&#39;t use &#x60;org&#x60; or &#x60;orgID&#x60;. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. (optional)
* @param \InfluxDB2\Model\Query $query Flux query or specification to execute (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postQueryRequest($zap_trace_span = null, $accept_encoding = 'identity', $content_type = null, $org = null, $org_id = null, $query = null)
{
$resourcePath = '/api/v2/query';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($org !== null) {
$queryParams['org'] = ObjectSerializer::toQueryValue($org);
}
// query params
if ($org_id !== null) {
$queryParams['orgID'] = ObjectSerializer::toQueryValue($org_id);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// header params
if ($accept_encoding !== null) {
$headerParams['Accept-Encoding'] = ObjectSerializer::toHeaderValue($accept_encoding);
}
// header params
if ($content_type !== null) {
$headerParams['Content-Type'] = ObjectSerializer::toHeaderValue($content_type);
}
// body params
$_tempBody = null;
if (isset($query)) {
$_tempBody = $query;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/csv', 'application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/csv', 'application/json'],
['application/json', 'application/vnd.flux']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postQueryAnalyze
*
* Analyze a Flux query
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_type content_type (optional)
* @param \InfluxDB2\Model\Query $query Flux query to analyze (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\AnalyzeQueryResponse|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function postQueryAnalyze($zap_trace_span = null, $content_type = null, $query = null)
{
list($response) = $this->postQueryAnalyzeWithHttpInfo($zap_trace_span, $content_type, $query);
return $response;
}
/**
* Operation postQueryAnalyzeWithHttpInfo
*
* Analyze a Flux query
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_type (optional)
* @param \InfluxDB2\Model\Query $query Flux query to analyze (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\AnalyzeQueryResponse|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function postQueryAnalyzeWithHttpInfo($zap_trace_span = null, $content_type = null, $query = null)
{
$request = $this->postQueryAnalyzeRequest($zap_trace_span, $content_type, $query);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\AnalyzeQueryResponse';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'postQueryAnalyze'
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_type (optional)
* @param \InfluxDB2\Model\Query $query Flux query to analyze (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postQueryAnalyzeRequest($zap_trace_span = null, $content_type = null, $query = null)
{
$resourcePath = '/api/v2/query/analyze';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// header params
if ($content_type !== null) {
$headerParams['Content-Type'] = ObjectSerializer::toHeaderValue($content_type);
}
// body params
$_tempBody = null;
if (isset($query)) {
$_tempBody = $query;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postQueryAst
*
* Generate a query Abstract Syntax Tree (AST)
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_type content_type (optional)
* @param \InfluxDB2\Model\LanguageRequest $language_request The Flux query to analyze. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\ASTResponse|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function postQueryAst($zap_trace_span = null, $content_type = null, $language_request = null)
{
list($response) = $this->postQueryAstWithHttpInfo($zap_trace_span, $content_type, $language_request);
return $response;
}
/**
* Operation postQueryAstWithHttpInfo
*
* Generate a query Abstract Syntax Tree (AST)
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_type (optional)
* @param \InfluxDB2\Model\LanguageRequest $language_request The Flux query to analyze. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\ASTResponse|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function postQueryAstWithHttpInfo($zap_trace_span = null, $content_type = null, $language_request = null)
{
$request = $this->postQueryAstRequest($zap_trace_span, $content_type, $language_request);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\ASTResponse';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'postQueryAst'
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_type (optional)
* @param \InfluxDB2\Model\LanguageRequest $language_request The Flux query to analyze. (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postQueryAstRequest($zap_trace_span = null, $content_type = null, $language_request = null)
{
$resourcePath = '/api/v2/query/ast';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// header params
if ($content_type !== null) {
$headerParams['Content-Type'] = ObjectSerializer::toHeaderValue($content_type);
}
// body params
$_tempBody = null;
if (isset($language_request)) {
$_tempBody = $language_request;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,170 @@
<?php
/**
* ReadyService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* ReadyService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class ReadyService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation getReady
*
* Get the readiness of an instance at startup
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Ready|string
*/
public function getReady($zap_trace_span = null)
{
list($response) = $this->getReadyWithHttpInfo($zap_trace_span);
return $response;
}
/**
* Operation getReadyWithHttpInfo
*
* Get the readiness of an instance at startup
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Ready|string, HTTP status code, HTTP response headers (array of strings)
*/
public function getReadyWithHttpInfo($zap_trace_span = null)
{
$request = $this->getReadyRequest($zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Ready';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getReady'
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getReadyRequest($zap_trace_span = null)
{
$resourcePath = '/ready';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,668 @@
<?php
/**
* RemoteConnectionsService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* RemoteConnectionsService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class RemoteConnectionsService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation deleteRemoteConnectionByID
*
* Delete a remote connection
*
* @param string $remote_id remote_id (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function deleteRemoteConnectionByID($remote_id, $zap_trace_span = null)
{
$this->deleteRemoteConnectionByIDWithHttpInfo($remote_id, $zap_trace_span);
}
/**
* Operation deleteRemoteConnectionByIDWithHttpInfo
*
* Delete a remote connection
*
* @param string $remote_id (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function deleteRemoteConnectionByIDWithHttpInfo($remote_id, $zap_trace_span = null)
{
$request = $this->deleteRemoteConnectionByIDRequest($remote_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'deleteRemoteConnectionByID'
*
* @param string $remote_id (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function deleteRemoteConnectionByIDRequest($remote_id, $zap_trace_span = null)
{
// verify the required parameter 'remote_id' is set
if ($remote_id === null || (is_array($remote_id) && count($remote_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $remote_id when calling deleteRemoteConnectionByID'
);
}
$resourcePath = '/api/v2/remotes/{remoteID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($remote_id !== null) {
$resourcePath = str_replace(
'{' . 'remoteID' . '}',
ObjectSerializer::toPathValue($remote_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('DELETE', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getRemoteConnectionByID
*
* Retrieve a remote connection
*
* @param string $remote_id remote_id (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\RemoteConnection|string|string
*/
public function getRemoteConnectionByID($remote_id, $zap_trace_span = null)
{
list($response) = $this->getRemoteConnectionByIDWithHttpInfo($remote_id, $zap_trace_span);
return $response;
}
/**
* Operation getRemoteConnectionByIDWithHttpInfo
*
* Retrieve a remote connection
*
* @param string $remote_id (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\RemoteConnection|string|string, HTTP status code, HTTP response headers (array of strings)
*/
public function getRemoteConnectionByIDWithHttpInfo($remote_id, $zap_trace_span = null)
{
$request = $this->getRemoteConnectionByIDRequest($remote_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\RemoteConnection';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getRemoteConnectionByID'
*
* @param string $remote_id (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getRemoteConnectionByIDRequest($remote_id, $zap_trace_span = null)
{
// verify the required parameter 'remote_id' is set
if ($remote_id === null || (is_array($remote_id) && count($remote_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $remote_id when calling getRemoteConnectionByID'
);
}
$resourcePath = '/api/v2/remotes/{remoteID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($remote_id !== null) {
$resourcePath = str_replace(
'{' . 'remoteID' . '}',
ObjectSerializer::toPathValue($remote_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getRemoteConnections
*
* List all remote connections
*
* @param string $org_id The organization ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $name name (optional)
* @param string $remote_url remote_url (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\RemoteConnections|string|string
*/
public function getRemoteConnections($org_id, $zap_trace_span = null, $name = null, $remote_url = null)
{
list($response) = $this->getRemoteConnectionsWithHttpInfo($org_id, $zap_trace_span, $name, $remote_url);
return $response;
}
/**
* Operation getRemoteConnectionsWithHttpInfo
*
* List all remote connections
*
* @param string $org_id The organization ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $name (optional)
* @param string $remote_url (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\RemoteConnections|string|string, HTTP status code, HTTP response headers (array of strings)
*/
public function getRemoteConnectionsWithHttpInfo($org_id, $zap_trace_span = null, $name = null, $remote_url = null)
{
$request = $this->getRemoteConnectionsRequest($org_id, $zap_trace_span, $name, $remote_url);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\RemoteConnections';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getRemoteConnections'
*
* @param string $org_id The organization ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $name (optional)
* @param string $remote_url (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getRemoteConnectionsRequest($org_id, $zap_trace_span = null, $name = null, $remote_url = null)
{
// verify the required parameter 'org_id' is set
if ($org_id === null || (is_array($org_id) && count($org_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $org_id when calling getRemoteConnections'
);
}
$resourcePath = '/api/v2/remotes';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($org_id !== null) {
$queryParams['orgID'] = ObjectSerializer::toQueryValue($org_id);
}
// query params
if ($name !== null) {
$queryParams['name'] = ObjectSerializer::toQueryValue($name);
}
// query params
if ($remote_url !== null) {
$queryParams['remoteURL'] = ObjectSerializer::toQueryValue($remote_url);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation patchRemoteConnectionByID
*
* Update a remote connection
*
* @param string $remote_id remote_id (required)
* @param \InfluxDB2\Model\RemoteConnectionUpdateRequest $remote_connection_update_request remote_connection_update_request (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\RemoteConnection|string|string|string
*/
public function patchRemoteConnectionByID($remote_id, $remote_connection_update_request, $zap_trace_span = null)
{
list($response) = $this->patchRemoteConnectionByIDWithHttpInfo($remote_id, $remote_connection_update_request, $zap_trace_span);
return $response;
}
/**
* Operation patchRemoteConnectionByIDWithHttpInfo
*
* Update a remote connection
*
* @param string $remote_id (required)
* @param \InfluxDB2\Model\RemoteConnectionUpdateRequest $remote_connection_update_request (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\RemoteConnection|string|string|string, HTTP status code, HTTP response headers (array of strings)
*/
public function patchRemoteConnectionByIDWithHttpInfo($remote_id, $remote_connection_update_request, $zap_trace_span = null)
{
$request = $this->patchRemoteConnectionByIDRequest($remote_id, $remote_connection_update_request, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\RemoteConnection';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'patchRemoteConnectionByID'
*
* @param string $remote_id (required)
* @param \InfluxDB2\Model\RemoteConnectionUpdateRequest $remote_connection_update_request (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function patchRemoteConnectionByIDRequest($remote_id, $remote_connection_update_request, $zap_trace_span = null)
{
// verify the required parameter 'remote_id' is set
if ($remote_id === null || (is_array($remote_id) && count($remote_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $remote_id when calling patchRemoteConnectionByID'
);
}
// verify the required parameter 'remote_connection_update_request' is set
if ($remote_connection_update_request === null || (is_array($remote_connection_update_request) && count($remote_connection_update_request) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $remote_connection_update_request when calling patchRemoteConnectionByID'
);
}
$resourcePath = '/api/v2/remotes/{remoteID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($remote_id !== null) {
$resourcePath = str_replace(
'{' . 'remoteID' . '}',
ObjectSerializer::toPathValue($remote_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($remote_connection_update_request)) {
$_tempBody = $remote_connection_update_request;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('PATCH', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postRemoteConnection
*
* Register a new remote connection
*
* @param \InfluxDB2\Model\RemoteConnectionCreationRequest $remote_connection_creation_request remote_connection_creation_request (required)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\RemoteConnection|string|string
*/
public function postRemoteConnection($remote_connection_creation_request)
{
list($response) = $this->postRemoteConnectionWithHttpInfo($remote_connection_creation_request);
return $response;
}
/**
* Operation postRemoteConnectionWithHttpInfo
*
* Register a new remote connection
*
* @param \InfluxDB2\Model\RemoteConnectionCreationRequest $remote_connection_creation_request (required)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\RemoteConnection|string|string, HTTP status code, HTTP response headers (array of strings)
*/
public function postRemoteConnectionWithHttpInfo($remote_connection_creation_request)
{
$request = $this->postRemoteConnectionRequest($remote_connection_creation_request);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\RemoteConnection';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'postRemoteConnection'
*
* @param \InfluxDB2\Model\RemoteConnectionCreationRequest $remote_connection_creation_request (required)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postRemoteConnectionRequest($remote_connection_creation_request)
{
// verify the required parameter 'remote_connection_creation_request' is set
if ($remote_connection_creation_request === null || (is_array($remote_connection_creation_request) && count($remote_connection_creation_request) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $remote_connection_creation_request when calling postRemoteConnection'
);
}
$resourcePath = '/api/v2/remotes';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// body params
$_tempBody = null;
if (isset($remote_connection_creation_request)) {
$_tempBody = $remote_connection_creation_request;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,804 @@
<?php
/**
* ReplicationsService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* ReplicationsService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class ReplicationsService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation deleteReplicationByID
*
* Delete a replication
*
* @param string $replication_id replication_id (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function deleteReplicationByID($replication_id, $zap_trace_span = null)
{
$this->deleteReplicationByIDWithHttpInfo($replication_id, $zap_trace_span);
}
/**
* Operation deleteReplicationByIDWithHttpInfo
*
* Delete a replication
*
* @param string $replication_id (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function deleteReplicationByIDWithHttpInfo($replication_id, $zap_trace_span = null)
{
$request = $this->deleteReplicationByIDRequest($replication_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'deleteReplicationByID'
*
* @param string $replication_id (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function deleteReplicationByIDRequest($replication_id, $zap_trace_span = null)
{
// verify the required parameter 'replication_id' is set
if ($replication_id === null || (is_array($replication_id) && count($replication_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $replication_id when calling deleteReplicationByID'
);
}
$resourcePath = '/api/v2/replications/{replicationID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($replication_id !== null) {
$resourcePath = str_replace(
'{' . 'replicationID' . '}',
ObjectSerializer::toPathValue($replication_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('DELETE', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getReplicationByID
*
* Retrieve a replication
*
* @param string $replication_id replication_id (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Replication|string|string
*/
public function getReplicationByID($replication_id, $zap_trace_span = null)
{
list($response) = $this->getReplicationByIDWithHttpInfo($replication_id, $zap_trace_span);
return $response;
}
/**
* Operation getReplicationByIDWithHttpInfo
*
* Retrieve a replication
*
* @param string $replication_id (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Replication|string|string, HTTP status code, HTTP response headers (array of strings)
*/
public function getReplicationByIDWithHttpInfo($replication_id, $zap_trace_span = null)
{
$request = $this->getReplicationByIDRequest($replication_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Replication';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getReplicationByID'
*
* @param string $replication_id (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getReplicationByIDRequest($replication_id, $zap_trace_span = null)
{
// verify the required parameter 'replication_id' is set
if ($replication_id === null || (is_array($replication_id) && count($replication_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $replication_id when calling getReplicationByID'
);
}
$resourcePath = '/api/v2/replications/{replicationID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($replication_id !== null) {
$resourcePath = str_replace(
'{' . 'replicationID' . '}',
ObjectSerializer::toPathValue($replication_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getReplications
*
* List all replications
*
* @param string $org_id The organization ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $name name (optional)
* @param string $remote_id remote_id (optional)
* @param string $local_bucket_id local_bucket_id (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Replications|string|string
*/
public function getReplications($org_id, $zap_trace_span = null, $name = null, $remote_id = null, $local_bucket_id = null)
{
list($response) = $this->getReplicationsWithHttpInfo($org_id, $zap_trace_span, $name, $remote_id, $local_bucket_id);
return $response;
}
/**
* Operation getReplicationsWithHttpInfo
*
* List all replications
*
* @param string $org_id The organization ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $name (optional)
* @param string $remote_id (optional)
* @param string $local_bucket_id (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Replications|string|string, HTTP status code, HTTP response headers (array of strings)
*/
public function getReplicationsWithHttpInfo($org_id, $zap_trace_span = null, $name = null, $remote_id = null, $local_bucket_id = null)
{
$request = $this->getReplicationsRequest($org_id, $zap_trace_span, $name, $remote_id, $local_bucket_id);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Replications';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getReplications'
*
* @param string $org_id The organization ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $name (optional)
* @param string $remote_id (optional)
* @param string $local_bucket_id (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getReplicationsRequest($org_id, $zap_trace_span = null, $name = null, $remote_id = null, $local_bucket_id = null)
{
// verify the required parameter 'org_id' is set
if ($org_id === null || (is_array($org_id) && count($org_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $org_id when calling getReplications'
);
}
$resourcePath = '/api/v2/replications';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($org_id !== null) {
$queryParams['orgID'] = ObjectSerializer::toQueryValue($org_id);
}
// query params
if ($name !== null) {
$queryParams['name'] = ObjectSerializer::toQueryValue($name);
}
// query params
if ($remote_id !== null) {
$queryParams['remoteID'] = ObjectSerializer::toQueryValue($remote_id);
}
// query params
if ($local_bucket_id !== null) {
$queryParams['localBucketID'] = ObjectSerializer::toQueryValue($local_bucket_id);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation patchReplicationByID
*
* Update a replication
*
* @param string $replication_id replication_id (required)
* @param \InfluxDB2\Model\ReplicationUpdateRequest $replication_update_request replication_update_request (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param bool $validate If true, validate the updated information, but don&#39;t save it. (optional, default to false)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Replication|string|string|string
*/
public function patchReplicationByID($replication_id, $replication_update_request, $zap_trace_span = null, $validate = false)
{
list($response) = $this->patchReplicationByIDWithHttpInfo($replication_id, $replication_update_request, $zap_trace_span, $validate);
return $response;
}
/**
* Operation patchReplicationByIDWithHttpInfo
*
* Update a replication
*
* @param string $replication_id (required)
* @param \InfluxDB2\Model\ReplicationUpdateRequest $replication_update_request (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param bool $validate If true, validate the updated information, but don&#39;t save it. (optional, default to false)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Replication|string|string|string, HTTP status code, HTTP response headers (array of strings)
*/
public function patchReplicationByIDWithHttpInfo($replication_id, $replication_update_request, $zap_trace_span = null, $validate = false)
{
$request = $this->patchReplicationByIDRequest($replication_id, $replication_update_request, $zap_trace_span, $validate);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Replication';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'patchReplicationByID'
*
* @param string $replication_id (required)
* @param \InfluxDB2\Model\ReplicationUpdateRequest $replication_update_request (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param bool $validate If true, validate the updated information, but don&#39;t save it. (optional, default to false)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function patchReplicationByIDRequest($replication_id, $replication_update_request, $zap_trace_span = null, $validate = false)
{
// verify the required parameter 'replication_id' is set
if ($replication_id === null || (is_array($replication_id) && count($replication_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $replication_id when calling patchReplicationByID'
);
}
// verify the required parameter 'replication_update_request' is set
if ($replication_update_request === null || (is_array($replication_update_request) && count($replication_update_request) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $replication_update_request when calling patchReplicationByID'
);
}
$resourcePath = '/api/v2/replications/{replicationID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($validate !== null) {
$queryParams['validate'] = ObjectSerializer::toQueryValue($validate);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($replication_id !== null) {
$resourcePath = str_replace(
'{' . 'replicationID' . '}',
ObjectSerializer::toPathValue($replication_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($replication_update_request)) {
$_tempBody = $replication_update_request;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('PATCH', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postReplication
*
* Register a new replication
*
* @param \InfluxDB2\Model\ReplicationCreationRequest $replication_creation_request replication_creation_request (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param bool $validate If true, validate the replication, but don&#39;t save it. (optional, default to false)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Replication|string|string
*/
public function postReplication($replication_creation_request, $zap_trace_span = null, $validate = false)
{
list($response) = $this->postReplicationWithHttpInfo($replication_creation_request, $zap_trace_span, $validate);
return $response;
}
/**
* Operation postReplicationWithHttpInfo
*
* Register a new replication
*
* @param \InfluxDB2\Model\ReplicationCreationRequest $replication_creation_request (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param bool $validate If true, validate the replication, but don&#39;t save it. (optional, default to false)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Replication|string|string, HTTP status code, HTTP response headers (array of strings)
*/
public function postReplicationWithHttpInfo($replication_creation_request, $zap_trace_span = null, $validate = false)
{
$request = $this->postReplicationRequest($replication_creation_request, $zap_trace_span, $validate);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Replication';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'postReplication'
*
* @param \InfluxDB2\Model\ReplicationCreationRequest $replication_creation_request (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param bool $validate If true, validate the replication, but don&#39;t save it. (optional, default to false)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postReplicationRequest($replication_creation_request, $zap_trace_span = null, $validate = false)
{
// verify the required parameter 'replication_creation_request' is set
if ($replication_creation_request === null || (is_array($replication_creation_request) && count($replication_creation_request) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $replication_creation_request when calling postReplication'
);
}
$resourcePath = '/api/v2/replications';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($validate !== null) {
$queryParams['validate'] = ObjectSerializer::toQueryValue($validate);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if (isset($replication_creation_request)) {
$_tempBody = $replication_creation_request;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postValidateReplicationByID
*
* Validate a replication
*
* @param string $replication_id replication_id (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function postValidateReplicationByID($replication_id, $zap_trace_span = null)
{
$this->postValidateReplicationByIDWithHttpInfo($replication_id, $zap_trace_span);
}
/**
* Operation postValidateReplicationByIDWithHttpInfo
*
* Validate a replication
*
* @param string $replication_id (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function postValidateReplicationByIDWithHttpInfo($replication_id, $zap_trace_span = null)
{
$request = $this->postValidateReplicationByIDRequest($replication_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'postValidateReplicationByID'
*
* @param string $replication_id (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postValidateReplicationByIDRequest($replication_id, $zap_trace_span = null)
{
// verify the required parameter 'replication_id' is set
if ($replication_id === null || (is_array($replication_id) && count($replication_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $replication_id when calling postValidateReplicationByID'
);
}
$resourcePath = '/api/v2/replications/{replicationID}/validate';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($replication_id !== null) {
$resourcePath = str_replace(
'{' . 'replicationID' . '}',
ObjectSerializer::toPathValue($replication_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,170 @@
<?php
/**
* ResourcesService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* ResourcesService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class ResourcesService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation getResources
*
* List all known resources
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return string[]|\InfluxDB2\Model\Error
*/
public function getResources($zap_trace_span = null)
{
list($response) = $this->getResourcesWithHttpInfo($zap_trace_span);
return $response;
}
/**
* Operation getResourcesWithHttpInfo
*
* List all known resources
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of string[]|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getResourcesWithHttpInfo($zap_trace_span = null)
{
$request = $this->getResourcesRequest($zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = 'string[]';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getResources'
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getResourcesRequest($zap_trace_span = null)
{
$resourcePath = '/api/v2/resources';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,703 @@
<?php
/**
* RestoreService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* RestoreService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class RestoreService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation postRestoreBucketID
*
* Overwrite storage metadata for a bucket with shard info from a backup.
*
* @param string $bucket_id The bucket ID. (required)
* @param string $body Database info serialized as protobuf. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_type content_type (optional, default to 'application/octet-stream')
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return string|string
*/
public function postRestoreBucketID($bucket_id, $body, $zap_trace_span = null, $content_type = 'application/octet-stream')
{
list($response) = $this->postRestoreBucketIDWithHttpInfo($bucket_id, $body, $zap_trace_span, $content_type);
return $response;
}
/**
* Operation postRestoreBucketIDWithHttpInfo
*
* Overwrite storage metadata for a bucket with shard info from a backup.
*
* @param string $bucket_id The bucket ID. (required)
* @param string $body Database info serialized as protobuf. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_type (optional, default to 'application/octet-stream')
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of string|string, HTTP status code, HTTP response headers (array of strings)
*/
public function postRestoreBucketIDWithHttpInfo($bucket_id, $body, $zap_trace_span = null, $content_type = 'application/octet-stream')
{
$request = $this->postRestoreBucketIDRequest($bucket_id, $body, $zap_trace_span, $content_type);
$response = $this->defaultApi->sendRequest($request);
$returnType = 'string';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'postRestoreBucketID'
*
* @param string $bucket_id The bucket ID. (required)
* @param string $body Database info serialized as protobuf. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_type (optional, default to 'application/octet-stream')
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postRestoreBucketIDRequest($bucket_id, $body, $zap_trace_span = null, $content_type = 'application/octet-stream')
{
// verify the required parameter 'bucket_id' is set
if ($bucket_id === null || (is_array($bucket_id) && count($bucket_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $bucket_id when calling postRestoreBucketID'
);
}
// verify the required parameter 'body' is set
if ($body === null || (is_array($body) && count($body) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $body when calling postRestoreBucketID'
);
}
$resourcePath = '/api/v2/restore/bucket/{bucketID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// header params
if ($content_type !== null) {
$headerParams['Content-Type'] = ObjectSerializer::toHeaderValue($content_type);
}
// path params
if ($bucket_id !== null) {
$resourcePath = str_replace(
'{' . 'bucketID' . '}',
ObjectSerializer::toPathValue($bucket_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($body)) {
$_tempBody = $body;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['text/plain']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postRestoreBucketMetadata
*
* Create a new bucket pre-seeded with shard info from a backup.
*
* @param \InfluxDB2\Model\BucketMetadataManifest $bucket_metadata_manifest Metadata manifest for a bucket. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\RestoredBucketMappings|string
*/
public function postRestoreBucketMetadata($bucket_metadata_manifest, $zap_trace_span = null)
{
list($response) = $this->postRestoreBucketMetadataWithHttpInfo($bucket_metadata_manifest, $zap_trace_span);
return $response;
}
/**
* Operation postRestoreBucketMetadataWithHttpInfo
*
* Create a new bucket pre-seeded with shard info from a backup.
*
* @param \InfluxDB2\Model\BucketMetadataManifest $bucket_metadata_manifest Metadata manifest for a bucket. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\RestoredBucketMappings|string, HTTP status code, HTTP response headers (array of strings)
*/
public function postRestoreBucketMetadataWithHttpInfo($bucket_metadata_manifest, $zap_trace_span = null)
{
$request = $this->postRestoreBucketMetadataRequest($bucket_metadata_manifest, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\RestoredBucketMappings';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'postRestoreBucketMetadata'
*
* @param \InfluxDB2\Model\BucketMetadataManifest $bucket_metadata_manifest Metadata manifest for a bucket. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postRestoreBucketMetadataRequest($bucket_metadata_manifest, $zap_trace_span = null)
{
// verify the required parameter 'bucket_metadata_manifest' is set
if ($bucket_metadata_manifest === null || (is_array($bucket_metadata_manifest) && count($bucket_metadata_manifest) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $bucket_metadata_manifest when calling postRestoreBucketMetadata'
);
}
$resourcePath = '/api/v2/restore/bucketMetadata';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if (isset($bucket_metadata_manifest)) {
$_tempBody = $bucket_metadata_manifest;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postRestoreKV
*
* Overwrite the embedded KV store on the server with a backed-up snapshot.
*
* @param \SplFileObject $body Full KV snapshot. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_encoding The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send &#x60;Content-Encoding: gzip&#x60; as a request header. (optional, default to 'identity')
* @param string $content_type content_type (optional, default to 'application/octet-stream')
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\PostRestoreKVResponse|string
*/
public function postRestoreKV($body, $zap_trace_span = null, $content_encoding = 'identity', $content_type = 'application/octet-stream')
{
list($response) = $this->postRestoreKVWithHttpInfo($body, $zap_trace_span, $content_encoding, $content_type);
return $response;
}
/**
* Operation postRestoreKVWithHttpInfo
*
* Overwrite the embedded KV store on the server with a backed-up snapshot.
*
* @param \SplFileObject $body Full KV snapshot. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_encoding The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send &#x60;Content-Encoding: gzip&#x60; as a request header. (optional, default to 'identity')
* @param string $content_type (optional, default to 'application/octet-stream')
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\PostRestoreKVResponse|string, HTTP status code, HTTP response headers (array of strings)
*/
public function postRestoreKVWithHttpInfo($body, $zap_trace_span = null, $content_encoding = 'identity', $content_type = 'application/octet-stream')
{
$request = $this->postRestoreKVRequest($body, $zap_trace_span, $content_encoding, $content_type);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\PostRestoreKVResponse';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'postRestoreKV'
*
* @param \SplFileObject $body Full KV snapshot. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_encoding The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send &#x60;Content-Encoding: gzip&#x60; as a request header. (optional, default to 'identity')
* @param string $content_type (optional, default to 'application/octet-stream')
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postRestoreKVRequest($body, $zap_trace_span = null, $content_encoding = 'identity', $content_type = 'application/octet-stream')
{
// verify the required parameter 'body' is set
if ($body === null || (is_array($body) && count($body) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $body when calling postRestoreKV'
);
}
$resourcePath = '/api/v2/restore/kv';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// header params
if ($content_encoding !== null) {
$headerParams['Content-Encoding'] = ObjectSerializer::toHeaderValue($content_encoding);
}
// header params
if ($content_type !== null) {
$headerParams['Content-Type'] = ObjectSerializer::toHeaderValue($content_type);
}
// body params
$_tempBody = null;
if (isset($body)) {
$_tempBody = $body;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['text/plain']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postRestoreSQL
*
* Overwrite the embedded SQL store on the server with a backed-up snapshot.
*
* @param \SplFileObject $body Full SQL snapshot. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_encoding The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send &#x60;Content-Encoding: gzip&#x60; as a request header. (optional, default to 'identity')
* @param string $content_type content_type (optional, default to 'application/octet-stream')
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function postRestoreSQL($body, $zap_trace_span = null, $content_encoding = 'identity', $content_type = 'application/octet-stream')
{
$this->postRestoreSQLWithHttpInfo($body, $zap_trace_span, $content_encoding, $content_type);
}
/**
* Operation postRestoreSQLWithHttpInfo
*
* Overwrite the embedded SQL store on the server with a backed-up snapshot.
*
* @param \SplFileObject $body Full SQL snapshot. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_encoding The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send &#x60;Content-Encoding: gzip&#x60; as a request header. (optional, default to 'identity')
* @param string $content_type (optional, default to 'application/octet-stream')
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function postRestoreSQLWithHttpInfo($body, $zap_trace_span = null, $content_encoding = 'identity', $content_type = 'application/octet-stream')
{
$request = $this->postRestoreSQLRequest($body, $zap_trace_span, $content_encoding, $content_type);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'postRestoreSQL'
*
* @param \SplFileObject $body Full SQL snapshot. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_encoding The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send &#x60;Content-Encoding: gzip&#x60; as a request header. (optional, default to 'identity')
* @param string $content_type (optional, default to 'application/octet-stream')
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postRestoreSQLRequest($body, $zap_trace_span = null, $content_encoding = 'identity', $content_type = 'application/octet-stream')
{
// verify the required parameter 'body' is set
if ($body === null || (is_array($body) && count($body) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $body when calling postRestoreSQL'
);
}
$resourcePath = '/api/v2/restore/sql';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// header params
if ($content_encoding !== null) {
$headerParams['Content-Encoding'] = ObjectSerializer::toHeaderValue($content_encoding);
}
// header params
if ($content_type !== null) {
$headerParams['Content-Type'] = ObjectSerializer::toHeaderValue($content_type);
}
// body params
$_tempBody = null;
if (isset($body)) {
$_tempBody = $body;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['text/plain']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postRestoreShardId
*
* Restore a TSM snapshot into a shard.
*
* @param string $shard_id The shard ID. (required)
* @param \SplFileObject $body TSM snapshot. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_encoding The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send &#x60;Content-Encoding: gzip&#x60; as a request header. (optional, default to 'identity')
* @param string $content_type content_type (optional, default to 'application/octet-stream')
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function postRestoreShardId($shard_id, $body, $zap_trace_span = null, $content_encoding = 'identity', $content_type = 'application/octet-stream')
{
$this->postRestoreShardIdWithHttpInfo($shard_id, $body, $zap_trace_span, $content_encoding, $content_type);
}
/**
* Operation postRestoreShardIdWithHttpInfo
*
* Restore a TSM snapshot into a shard.
*
* @param string $shard_id The shard ID. (required)
* @param \SplFileObject $body TSM snapshot. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_encoding The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send &#x60;Content-Encoding: gzip&#x60; as a request header. (optional, default to 'identity')
* @param string $content_type (optional, default to 'application/octet-stream')
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function postRestoreShardIdWithHttpInfo($shard_id, $body, $zap_trace_span = null, $content_encoding = 'identity', $content_type = 'application/octet-stream')
{
$request = $this->postRestoreShardIdRequest($shard_id, $body, $zap_trace_span, $content_encoding, $content_type);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'postRestoreShardId'
*
* @param string $shard_id The shard ID. (required)
* @param \SplFileObject $body TSM snapshot. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_encoding The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send &#x60;Content-Encoding: gzip&#x60; as a request header. (optional, default to 'identity')
* @param string $content_type (optional, default to 'application/octet-stream')
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postRestoreShardIdRequest($shard_id, $body, $zap_trace_span = null, $content_encoding = 'identity', $content_type = 'application/octet-stream')
{
// verify the required parameter 'shard_id' is set
if ($shard_id === null || (is_array($shard_id) && count($shard_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $shard_id when calling postRestoreShardId'
);
}
// verify the required parameter 'body' is set
if ($body === null || (is_array($body) && count($body) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $body when calling postRestoreShardId'
);
}
$resourcePath = '/api/v2/restore/shards/{shardID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// header params
if ($content_encoding !== null) {
$headerParams['Content-Encoding'] = ObjectSerializer::toHeaderValue($content_encoding);
}
// header params
if ($content_type !== null) {
$headerParams['Content-Type'] = ObjectSerializer::toHeaderValue($content_type);
}
// path params
if ($shard_id !== null) {
$resourcePath = str_replace(
'{' . 'shardID' . '}',
ObjectSerializer::toPathValue($shard_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($body)) {
$_tempBody = $body;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['text/plain']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,170 @@
<?php
/**
* RoutesService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* RoutesService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class RoutesService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation getRoutes
*
* List all top level routes
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Routes
*/
public function getRoutes($zap_trace_span = null)
{
list($response) = $this->getRoutesWithHttpInfo($zap_trace_span);
return $response;
}
/**
* Operation getRoutesWithHttpInfo
*
* List all top level routes
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Routes, HTTP status code, HTTP response headers (array of strings)
*/
public function getRoutesWithHttpInfo($zap_trace_span = null)
{
$request = $this->getRoutesRequest($zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Routes';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getRoutes'
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getRoutesRequest($zap_trace_span = null)
{
$resourcePath = '/api/v2/';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,187 @@
<?php
/**
* RulesService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* RulesService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class RulesService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation getNotificationRulesIDQuery
*
* Retrieve a notification rule query
*
* @param string $rule_id The notification rule ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\FluxResponse|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function getNotificationRulesIDQuery($rule_id, $zap_trace_span = null)
{
list($response) = $this->getNotificationRulesIDQueryWithHttpInfo($rule_id, $zap_trace_span);
return $response;
}
/**
* Operation getNotificationRulesIDQueryWithHttpInfo
*
* Retrieve a notification rule query
*
* @param string $rule_id The notification rule ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\FluxResponse|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getNotificationRulesIDQueryWithHttpInfo($rule_id, $zap_trace_span = null)
{
$request = $this->getNotificationRulesIDQueryRequest($rule_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\FluxResponse';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getNotificationRulesIDQuery'
*
* @param string $rule_id The notification rule ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getNotificationRulesIDQueryRequest($rule_id, $zap_trace_span = null)
{
// verify the required parameter 'rule_id' is set
if ($rule_id === null || (is_array($rule_id) && count($rule_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $rule_id when calling getNotificationRulesIDQuery'
);
}
$resourcePath = '/api/v2/notificationRules/{ruleID}/query';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($rule_id !== null) {
$resourcePath = str_replace(
'{' . 'ruleID' . '}',
ObjectSerializer::toPathValue($rule_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,552 @@
<?php
/**
* SecretsService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* SecretsService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class SecretsService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation deleteOrgsIDSecretsID
*
* Delete a secret from an organization
*
* @param string $org_id The organization ID. (required)
* @param string $secret_id The secret ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function deleteOrgsIDSecretsID($org_id, $secret_id, $zap_trace_span = null)
{
$this->deleteOrgsIDSecretsIDWithHttpInfo($org_id, $secret_id, $zap_trace_span);
}
/**
* Operation deleteOrgsIDSecretsIDWithHttpInfo
*
* Delete a secret from an organization
*
* @param string $org_id The organization ID. (required)
* @param string $secret_id The secret ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function deleteOrgsIDSecretsIDWithHttpInfo($org_id, $secret_id, $zap_trace_span = null)
{
$request = $this->deleteOrgsIDSecretsIDRequest($org_id, $secret_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'deleteOrgsIDSecretsID'
*
* @param string $org_id The organization ID. (required)
* @param string $secret_id The secret ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function deleteOrgsIDSecretsIDRequest($org_id, $secret_id, $zap_trace_span = null)
{
// verify the required parameter 'org_id' is set
if ($org_id === null || (is_array($org_id) && count($org_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $org_id when calling deleteOrgsIDSecretsID'
);
}
// verify the required parameter 'secret_id' is set
if ($secret_id === null || (is_array($secret_id) && count($secret_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $secret_id when calling deleteOrgsIDSecretsID'
);
}
$resourcePath = '/api/v2/orgs/{orgID}/secrets/{secretID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($org_id !== null) {
$resourcePath = str_replace(
'{' . 'orgID' . '}',
ObjectSerializer::toPathValue($org_id),
$resourcePath
);
}
// path params
if ($secret_id !== null) {
$resourcePath = str_replace(
'{' . 'secretID' . '}',
ObjectSerializer::toPathValue($secret_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('DELETE', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getOrgsIDSecrets
*
* List all secret keys for an organization
*
* @param string $org_id The organization ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\SecretKeysResponse|\InfluxDB2\Model\Error
*/
public function getOrgsIDSecrets($org_id, $zap_trace_span = null)
{
list($response) = $this->getOrgsIDSecretsWithHttpInfo($org_id, $zap_trace_span);
return $response;
}
/**
* Operation getOrgsIDSecretsWithHttpInfo
*
* List all secret keys for an organization
*
* @param string $org_id The organization ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\SecretKeysResponse|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getOrgsIDSecretsWithHttpInfo($org_id, $zap_trace_span = null)
{
$request = $this->getOrgsIDSecretsRequest($org_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\SecretKeysResponse';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getOrgsIDSecrets'
*
* @param string $org_id The organization ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getOrgsIDSecretsRequest($org_id, $zap_trace_span = null)
{
// verify the required parameter 'org_id' is set
if ($org_id === null || (is_array($org_id) && count($org_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $org_id when calling getOrgsIDSecrets'
);
}
$resourcePath = '/api/v2/orgs/{orgID}/secrets';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($org_id !== null) {
$resourcePath = str_replace(
'{' . 'orgID' . '}',
ObjectSerializer::toPathValue($org_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation patchOrgsIDSecrets
*
* Update secrets in an organization
*
* @param string $org_id The organization ID. (required)
* @param map[string,string] $request_body Secret key value pairs to update/add (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function patchOrgsIDSecrets($org_id, $request_body, $zap_trace_span = null)
{
$this->patchOrgsIDSecretsWithHttpInfo($org_id, $request_body, $zap_trace_span);
}
/**
* Operation patchOrgsIDSecretsWithHttpInfo
*
* Update secrets in an organization
*
* @param string $org_id The organization ID. (required)
* @param map[string,string] $request_body Secret key value pairs to update/add (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function patchOrgsIDSecretsWithHttpInfo($org_id, $request_body, $zap_trace_span = null)
{
$request = $this->patchOrgsIDSecretsRequest($org_id, $request_body, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'patchOrgsIDSecrets'
*
* @param string $org_id The organization ID. (required)
* @param map[string,string] $request_body Secret key value pairs to update/add (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function patchOrgsIDSecretsRequest($org_id, $request_body, $zap_trace_span = null)
{
// verify the required parameter 'org_id' is set
if ($org_id === null || (is_array($org_id) && count($org_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $org_id when calling patchOrgsIDSecrets'
);
}
// verify the required parameter 'request_body' is set
if ($request_body === null || (is_array($request_body) && count($request_body) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $request_body when calling patchOrgsIDSecrets'
);
}
$resourcePath = '/api/v2/orgs/{orgID}/secrets';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($org_id !== null) {
$resourcePath = str_replace(
'{' . 'orgID' . '}',
ObjectSerializer::toPathValue($org_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($request_body)) {
$_tempBody = $request_body;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('PATCH', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postOrgsIDSecrets
*
* Delete secrets from an organization
*
* @param string $org_id The organization ID. (required)
* @param \InfluxDB2\Model\SecretKeys $secret_keys Secret key to delete (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function postOrgsIDSecrets($org_id, $secret_keys, $zap_trace_span = null)
{
$this->postOrgsIDSecretsWithHttpInfo($org_id, $secret_keys, $zap_trace_span);
}
/**
* Operation postOrgsIDSecretsWithHttpInfo
*
* Delete secrets from an organization
*
* @param string $org_id The organization ID. (required)
* @param \InfluxDB2\Model\SecretKeys $secret_keys Secret key to delete (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function postOrgsIDSecretsWithHttpInfo($org_id, $secret_keys, $zap_trace_span = null)
{
$request = $this->postOrgsIDSecretsRequest($org_id, $secret_keys, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'postOrgsIDSecrets'
*
* @param string $org_id The organization ID. (required)
* @param \InfluxDB2\Model\SecretKeys $secret_keys Secret key to delete (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postOrgsIDSecretsRequest($org_id, $secret_keys, $zap_trace_span = null)
{
// verify the required parameter 'org_id' is set
if ($org_id === null || (is_array($org_id) && count($org_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $org_id when calling postOrgsIDSecrets'
);
}
// verify the required parameter 'secret_keys' is set
if ($secret_keys === null || (is_array($secret_keys) && count($secret_keys) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $secret_keys when calling postOrgsIDSecrets'
);
}
$resourcePath = '/api/v2/orgs/{orgID}/secrets/delete';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($org_id !== null) {
$resourcePath = str_replace(
'{' . 'orgID' . '}',
ObjectSerializer::toPathValue($org_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($secret_keys)) {
$_tempBody = $secret_keys;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,286 @@
<?php
/**
* SetupService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* SetupService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class SetupService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation getSetup
*
* Check if database has default user, org, bucket
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\IsOnboarding
*/
public function getSetup($zap_trace_span = null)
{
list($response) = $this->getSetupWithHttpInfo($zap_trace_span);
return $response;
}
/**
* Operation getSetupWithHttpInfo
*
* Check if database has default user, org, bucket
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\IsOnboarding, HTTP status code, HTTP response headers (array of strings)
*/
public function getSetupWithHttpInfo($zap_trace_span = null)
{
$request = $this->getSetupRequest($zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\IsOnboarding';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getSetup'
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getSetupRequest($zap_trace_span = null)
{
$resourcePath = '/api/v2/setup';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postSetup
*
* Set up initial user, org and bucket
*
* @param \InfluxDB2\Model\OnboardingRequest $onboarding_request Source to create (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\OnboardingResponse|string
*/
public function postSetup($onboarding_request, $zap_trace_span = null)
{
list($response) = $this->postSetupWithHttpInfo($onboarding_request, $zap_trace_span);
return $response;
}
/**
* Operation postSetupWithHttpInfo
*
* Set up initial user, org and bucket
*
* @param \InfluxDB2\Model\OnboardingRequest $onboarding_request Source to create (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\OnboardingResponse|string, HTTP status code, HTTP response headers (array of strings)
*/
public function postSetupWithHttpInfo($onboarding_request, $zap_trace_span = null)
{
$request = $this->postSetupRequest($onboarding_request, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\OnboardingResponse';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'postSetup'
*
* @param \InfluxDB2\Model\OnboardingRequest $onboarding_request Source to create (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postSetupRequest($onboarding_request, $zap_trace_span = null)
{
// verify the required parameter 'onboarding_request' is set
if ($onboarding_request === null || (is_array($onboarding_request) && count($onboarding_request) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $onboarding_request when calling postSetup'
);
}
$resourcePath = '/api/v2/setup';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if (isset($onboarding_request)) {
$_tempBody = $onboarding_request;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,168 @@
<?php
/**
* SigninService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* SigninService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class SigninService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation postSignin
*
* Create a user session.
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $authorization An auth credential for the Basic scheme (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function postSignin($zap_trace_span = null, $authorization = null)
{
$this->postSigninWithHttpInfo($zap_trace_span, $authorization);
}
/**
* Operation postSigninWithHttpInfo
*
* Create a user session.
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $authorization An auth credential for the Basic scheme (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function postSigninWithHttpInfo($zap_trace_span = null, $authorization = null)
{
$request = $this->postSigninRequest($zap_trace_span, $authorization);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'postSignin'
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $authorization An auth credential for the Basic scheme (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postSigninRequest($zap_trace_span = null, $authorization = null)
{
$resourcePath = '/api/v2/signin';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// header params
if ($authorization !== null) {
$headerParams['Authorization'] = ObjectSerializer::toHeaderValue($authorization);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
// this endpoint requires HTTP basic authentication
if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,157 @@
<?php
/**
* SignoutService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* SignoutService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class SignoutService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation postSignout
*
* Expire the current UI session
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function postSignout($zap_trace_span = null)
{
$this->postSignoutWithHttpInfo($zap_trace_span);
}
/**
* Operation postSignoutWithHttpInfo
*
* Expire the current UI session
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function postSignoutWithHttpInfo($zap_trace_span = null)
{
$request = $this->postSignoutRequest($zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'postSignout'
*
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postSignoutRequest($zap_trace_span = null)
{
$resourcePath = '/api/v2/signout';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,904 @@
<?php
/**
* SourcesService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* SourcesService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class SourcesService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation deleteSourcesID
*
* Delete a source
*
* @param string $source_id The source ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function deleteSourcesID($source_id, $zap_trace_span = null)
{
$this->deleteSourcesIDWithHttpInfo($source_id, $zap_trace_span);
}
/**
* Operation deleteSourcesIDWithHttpInfo
*
* Delete a source
*
* @param string $source_id The source ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function deleteSourcesIDWithHttpInfo($source_id, $zap_trace_span = null)
{
$request = $this->deleteSourcesIDRequest($source_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'deleteSourcesID'
*
* @param string $source_id The source ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function deleteSourcesIDRequest($source_id, $zap_trace_span = null)
{
// verify the required parameter 'source_id' is set
if ($source_id === null || (is_array($source_id) && count($source_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $source_id when calling deleteSourcesID'
);
}
$resourcePath = '/api/v2/sources/{sourceID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($source_id !== null) {
$resourcePath = str_replace(
'{' . 'sourceID' . '}',
ObjectSerializer::toPathValue($source_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('DELETE', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getSources
*
* List all sources
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org The name of the organization. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Sources|\InfluxDB2\Model\Error
*/
public function getSources($zap_trace_span = null, $org = null)
{
list($response) = $this->getSourcesWithHttpInfo($zap_trace_span, $org);
return $response;
}
/**
* Operation getSourcesWithHttpInfo
*
* List all sources
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org The name of the organization. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Sources|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getSourcesWithHttpInfo($zap_trace_span = null, $org = null)
{
$request = $this->getSourcesRequest($zap_trace_span, $org);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Sources';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getSources'
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org The name of the organization. (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getSourcesRequest($zap_trace_span = null, $org = null)
{
$resourcePath = '/api/v2/sources';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($org !== null) {
$queryParams['org'] = ObjectSerializer::toQueryValue($org);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getSourcesID
*
* Retrieve a source
*
* @param string $source_id The source ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Source|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function getSourcesID($source_id, $zap_trace_span = null)
{
list($response) = $this->getSourcesIDWithHttpInfo($source_id, $zap_trace_span);
return $response;
}
/**
* Operation getSourcesIDWithHttpInfo
*
* Retrieve a source
*
* @param string $source_id The source ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Source|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getSourcesIDWithHttpInfo($source_id, $zap_trace_span = null)
{
$request = $this->getSourcesIDRequest($source_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Source';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getSourcesID'
*
* @param string $source_id The source ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getSourcesIDRequest($source_id, $zap_trace_span = null)
{
// verify the required parameter 'source_id' is set
if ($source_id === null || (is_array($source_id) && count($source_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $source_id when calling getSourcesID'
);
}
$resourcePath = '/api/v2/sources/{sourceID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($source_id !== null) {
$resourcePath = str_replace(
'{' . 'sourceID' . '}',
ObjectSerializer::toPathValue($source_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getSourcesIDBuckets
*
* Get buckets in a source
*
* @param string $source_id The source ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org The name of the organization. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Buckets|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function getSourcesIDBuckets($source_id, $zap_trace_span = null, $org = null)
{
list($response) = $this->getSourcesIDBucketsWithHttpInfo($source_id, $zap_trace_span, $org);
return $response;
}
/**
* Operation getSourcesIDBucketsWithHttpInfo
*
* Get buckets in a source
*
* @param string $source_id The source ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org The name of the organization. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Buckets|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getSourcesIDBucketsWithHttpInfo($source_id, $zap_trace_span = null, $org = null)
{
$request = $this->getSourcesIDBucketsRequest($source_id, $zap_trace_span, $org);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Buckets';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getSourcesIDBuckets'
*
* @param string $source_id The source ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $org The name of the organization. (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getSourcesIDBucketsRequest($source_id, $zap_trace_span = null, $org = null)
{
// verify the required parameter 'source_id' is set
if ($source_id === null || (is_array($source_id) && count($source_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $source_id when calling getSourcesIDBuckets'
);
}
$resourcePath = '/api/v2/sources/{sourceID}/buckets';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($org !== null) {
$queryParams['org'] = ObjectSerializer::toQueryValue($org);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($source_id !== null) {
$resourcePath = str_replace(
'{' . 'sourceID' . '}',
ObjectSerializer::toPathValue($source_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation getSourcesIDHealth
*
* Get the health of a source
*
* @param string $source_id The source ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\HealthCheck|\InfluxDB2\Model\HealthCheck|\InfluxDB2\Model\Error
*/
public function getSourcesIDHealth($source_id, $zap_trace_span = null)
{
list($response) = $this->getSourcesIDHealthWithHttpInfo($source_id, $zap_trace_span);
return $response;
}
/**
* Operation getSourcesIDHealthWithHttpInfo
*
* Get the health of a source
*
* @param string $source_id The source ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\HealthCheck|\InfluxDB2\Model\HealthCheck|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getSourcesIDHealthWithHttpInfo($source_id, $zap_trace_span = null)
{
$request = $this->getSourcesIDHealthRequest($source_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\HealthCheck';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getSourcesIDHealth'
*
* @param string $source_id The source ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getSourcesIDHealthRequest($source_id, $zap_trace_span = null)
{
// verify the required parameter 'source_id' is set
if ($source_id === null || (is_array($source_id) && count($source_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $source_id when calling getSourcesIDHealth'
);
}
$resourcePath = '/api/v2/sources/{sourceID}/health';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($source_id !== null) {
$resourcePath = str_replace(
'{' . 'sourceID' . '}',
ObjectSerializer::toPathValue($source_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation patchSourcesID
*
* Update a Source
*
* @param string $source_id The source ID. (required)
* @param \InfluxDB2\Model\Source $source Source update (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Source|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function patchSourcesID($source_id, $source, $zap_trace_span = null)
{
list($response) = $this->patchSourcesIDWithHttpInfo($source_id, $source, $zap_trace_span);
return $response;
}
/**
* Operation patchSourcesIDWithHttpInfo
*
* Update a Source
*
* @param string $source_id The source ID. (required)
* @param \InfluxDB2\Model\Source $source Source update (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Source|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function patchSourcesIDWithHttpInfo($source_id, $source, $zap_trace_span = null)
{
$request = $this->patchSourcesIDRequest($source_id, $source, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Source';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'patchSourcesID'
*
* @param string $source_id The source ID. (required)
* @param \InfluxDB2\Model\Source $source Source update (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function patchSourcesIDRequest($source_id, $source, $zap_trace_span = null)
{
// verify the required parameter 'source_id' is set
if ($source_id === null || (is_array($source_id) && count($source_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $source_id when calling patchSourcesID'
);
}
// verify the required parameter 'source' is set
if ($source === null || (is_array($source) && count($source) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $source when calling patchSourcesID'
);
}
$resourcePath = '/api/v2/sources/{sourceID}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($source_id !== null) {
$resourcePath = str_replace(
'{' . 'sourceID' . '}',
ObjectSerializer::toPathValue($source_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($source)) {
$_tempBody = $source;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('PATCH', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation postSources
*
* Create a source
*
* @param \InfluxDB2\Model\Source $source Source to create (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Source|\InfluxDB2\Model\Error
*/
public function postSources($source, $zap_trace_span = null)
{
list($response) = $this->postSourcesWithHttpInfo($source, $zap_trace_span);
return $response;
}
/**
* Operation postSourcesWithHttpInfo
*
* Create a source
*
* @param \InfluxDB2\Model\Source $source Source to create (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Source|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function postSourcesWithHttpInfo($source, $zap_trace_span = null)
{
$request = $this->postSourcesRequest($source, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Source';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'postSources'
*
* @param \InfluxDB2\Model\Source $source Source to create (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postSourcesRequest($source, $zap_trace_span = null)
{
// verify the required parameter 'source' is set
if ($source === null || (is_array($source) && count($source) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $source when calling postSources'
);
}
$resourcePath = '/api/v2/sources';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if (isset($source)) {
$_tempBody = $source;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,177 @@
<?php
/**
* TelegrafPluginsService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* TelegrafPluginsService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class TelegrafPluginsService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation getTelegrafPlugins
*
* List all Telegraf plugins
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $type The type of plugin desired. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\TelegrafPlugins|\InfluxDB2\Model\Error
*/
public function getTelegrafPlugins($zap_trace_span = null, $type = null)
{
list($response) = $this->getTelegrafPluginsWithHttpInfo($zap_trace_span, $type);
return $response;
}
/**
* Operation getTelegrafPluginsWithHttpInfo
*
* List all Telegraf plugins
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $type The type of plugin desired. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\TelegrafPlugins|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getTelegrafPluginsWithHttpInfo($zap_trace_span = null, $type = null)
{
$request = $this->getTelegrafPluginsRequest($zap_trace_span, $type);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\TelegrafPlugins';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getTelegrafPlugins'
*
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $type The type of plugin desired. (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getTelegrafPluginsRequest($zap_trace_span = null, $type = null)
{
$resourcePath = '/api/v2/telegraf/plugins';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($type !== null) {
$queryParams['type'] = ObjectSerializer::toQueryValue($type);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,967 @@
<?php
/**
* TemplatesService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* TemplatesService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class TemplatesService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation applyTemplate
*
* Apply or dry-run a template
*
* @param \InfluxDB2\Model\TemplateApply $template_apply Parameters for applying templates. (required)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\TemplateSummary|\InfluxDB2\Model\TemplateSummary|TemplateSummary|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function applyTemplate($template_apply)
{
list($response) = $this->applyTemplateWithHttpInfo($template_apply);
return $response;
}
/**
* Operation applyTemplateWithHttpInfo
*
* Apply or dry-run a template
*
* @param \InfluxDB2\Model\TemplateApply $template_apply Parameters for applying templates. (required)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\TemplateSummary|\InfluxDB2\Model\TemplateSummary|TemplateSummary|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function applyTemplateWithHttpInfo($template_apply)
{
$request = $this->applyTemplateRequest($template_apply);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\TemplateSummary';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'applyTemplate'
*
* @param \InfluxDB2\Model\TemplateApply $template_apply Parameters for applying templates. (required)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function applyTemplateRequest($template_apply)
{
// verify the required parameter 'template_apply' is set
if ($template_apply === null || (is_array($template_apply) && count($template_apply) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $template_apply when calling applyTemplate'
);
}
$resourcePath = '/api/v2/templates/apply';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// body params
$_tempBody = null;
if (isset($template_apply)) {
$_tempBody = $template_apply;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json', 'application/x-jsonnet', 'text/yml']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation createStack
*
* Create a stack
*
* @param \InfluxDB2\Model\PostStackRequest1 $post_stack_request1 post_stack_request1 (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Stack|object|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function createStack($post_stack_request1 = null)
{
list($response) = $this->createStackWithHttpInfo($post_stack_request1);
return $response;
}
/**
* Operation createStackWithHttpInfo
*
* Create a stack
*
* @param \InfluxDB2\Model\PostStackRequest1 $post_stack_request1 (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Stack|object|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function createStackWithHttpInfo($post_stack_request1 = null)
{
$request = $this->createStackRequest($post_stack_request1);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Stack';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'createStack'
*
* @param \InfluxDB2\Model\PostStackRequest1 $post_stack_request1 (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function createStackRequest($post_stack_request1 = null)
{
$resourcePath = '/api/v2/stacks';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// body params
$_tempBody = null;
if (isset($post_stack_request1)) {
$_tempBody = $post_stack_request1;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation deleteStack
*
* Delete a stack and associated resources
*
* @param string $stack_id The identifier of the stack. (required)
* @param string $org_id The identifier of the organization. (required)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function deleteStack($stack_id, $org_id)
{
$this->deleteStackWithHttpInfo($stack_id, $org_id);
}
/**
* Operation deleteStackWithHttpInfo
*
* Delete a stack and associated resources
*
* @param string $stack_id The identifier of the stack. (required)
* @param string $org_id The identifier of the organization. (required)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function deleteStackWithHttpInfo($stack_id, $org_id)
{
$request = $this->deleteStackRequest($stack_id, $org_id);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'deleteStack'
*
* @param string $stack_id The identifier of the stack. (required)
* @param string $org_id The identifier of the organization. (required)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function deleteStackRequest($stack_id, $org_id)
{
// verify the required parameter 'stack_id' is set
if ($stack_id === null || (is_array($stack_id) && count($stack_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $stack_id when calling deleteStack'
);
}
// verify the required parameter 'org_id' is set
if ($org_id === null || (is_array($org_id) && count($org_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $org_id when calling deleteStack'
);
}
$resourcePath = '/api/v2/stacks/{stack_id}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($org_id !== null) {
$queryParams['orgID'] = ObjectSerializer::toQueryValue($org_id);
}
// path params
if ($stack_id !== null) {
$resourcePath = str_replace(
'{' . 'stack_id' . '}',
ObjectSerializer::toPathValue($stack_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('DELETE', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation exportTemplate
*
* Export a new template
*
* @param \InfluxDB2\Model\TemplateExportByID $template_export_by_id Export resources as an InfluxDB template. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return object[]|\InfluxDB2\Model\Error
*/
public function exportTemplate($template_export_by_id = null)
{
list($response) = $this->exportTemplateWithHttpInfo($template_export_by_id);
return $response;
}
/**
* Operation exportTemplateWithHttpInfo
*
* Export a new template
*
* @param \InfluxDB2\Model\TemplateExportByID $template_export_by_id Export resources as an InfluxDB template. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of object[]|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function exportTemplateWithHttpInfo($template_export_by_id = null)
{
$request = $this->exportTemplateRequest($template_export_by_id);
$response = $this->defaultApi->sendRequest($request);
$returnType = 'object[]';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'exportTemplate'
*
* @param \InfluxDB2\Model\TemplateExportByID $template_export_by_id Export resources as an InfluxDB template. (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function exportTemplateRequest($template_export_by_id = null)
{
$resourcePath = '/api/v2/templates/export';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// body params
$_tempBody = null;
if (isset($template_export_by_id)) {
$_tempBody = $template_export_by_id;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json', 'application/x-yaml']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json', 'application/x-yaml'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation listStacks
*
* List installed stacks
*
* @param string $org_id The ID of the organization that owns the stacks. Only returns stacks owned by this organization. #### InfluxDB Cloud - Doesn&#39;t require this parameter; InfluxDB only returns resources allowed by the API token. (required)
* @param string $name The stack name. Finds stack &#x60;events&#x60; with this name and returns the stacks. Repeatable. To filter for more than one stack name, repeat this parameter with each name--for example: - &#x60;http://localhost:8086/api/v2/stacks?&amp;orgID&#x3D;INFLUX_ORG_ID&amp;name&#x3D;project-stack-0&amp;name&#x3D;project-stack-1&#x60; (optional)
* @param string $stack_id The stack ID. Only returns stacks with this ID. Repeatable. To filter for more than one stack ID, repeat this parameter with each ID--for example: - &#x60;http://localhost:8086/api/v2/stacks?&amp;orgID&#x3D;INFLUX_ORG_ID&amp;stackID&#x3D;09bd87cd33be3000&amp;stackID&#x3D;09bef35081fe3000&#x60; (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\ListStacksResponse|\InfluxDB2\Model\Error|object|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function listStacks($org_id, $name = null, $stack_id = null)
{
list($response) = $this->listStacksWithHttpInfo($org_id, $name, $stack_id);
return $response;
}
/**
* Operation listStacksWithHttpInfo
*
* List installed stacks
*
* @param string $org_id The ID of the organization that owns the stacks. Only returns stacks owned by this organization. #### InfluxDB Cloud - Doesn&#39;t require this parameter; InfluxDB only returns resources allowed by the API token. (required)
* @param string $name The stack name. Finds stack &#x60;events&#x60; with this name and returns the stacks. Repeatable. To filter for more than one stack name, repeat this parameter with each name--for example: - &#x60;http://localhost:8086/api/v2/stacks?&amp;orgID&#x3D;INFLUX_ORG_ID&amp;name&#x3D;project-stack-0&amp;name&#x3D;project-stack-1&#x60; (optional)
* @param string $stack_id The stack ID. Only returns stacks with this ID. Repeatable. To filter for more than one stack ID, repeat this parameter with each ID--for example: - &#x60;http://localhost:8086/api/v2/stacks?&amp;orgID&#x3D;INFLUX_ORG_ID&amp;stackID&#x3D;09bd87cd33be3000&amp;stackID&#x3D;09bef35081fe3000&#x60; (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\ListStacksResponse|\InfluxDB2\Model\Error|object|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function listStacksWithHttpInfo($org_id, $name = null, $stack_id = null)
{
$request = $this->listStacksRequest($org_id, $name, $stack_id);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\ListStacksResponse';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'listStacks'
*
* @param string $org_id The ID of the organization that owns the stacks. Only returns stacks owned by this organization. #### InfluxDB Cloud - Doesn&#39;t require this parameter; InfluxDB only returns resources allowed by the API token. (required)
* @param string $name The stack name. Finds stack &#x60;events&#x60; with this name and returns the stacks. Repeatable. To filter for more than one stack name, repeat this parameter with each name--for example: - &#x60;http://localhost:8086/api/v2/stacks?&amp;orgID&#x3D;INFLUX_ORG_ID&amp;name&#x3D;project-stack-0&amp;name&#x3D;project-stack-1&#x60; (optional)
* @param string $stack_id The stack ID. Only returns stacks with this ID. Repeatable. To filter for more than one stack ID, repeat this parameter with each ID--for example: - &#x60;http://localhost:8086/api/v2/stacks?&amp;orgID&#x3D;INFLUX_ORG_ID&amp;stackID&#x3D;09bd87cd33be3000&amp;stackID&#x3D;09bef35081fe3000&#x60; (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function listStacksRequest($org_id, $name = null, $stack_id = null)
{
// verify the required parameter 'org_id' is set
if ($org_id === null || (is_array($org_id) && count($org_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $org_id when calling listStacks'
);
}
$resourcePath = '/api/v2/stacks';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($org_id !== null) {
$queryParams['orgID'] = ObjectSerializer::toQueryValue($org_id);
}
// query params
if ($name !== null) {
$queryParams['name'] = ObjectSerializer::toQueryValue($name);
}
// query params
if ($stack_id !== null) {
$queryParams['stackID'] = ObjectSerializer::toQueryValue($stack_id);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation readStack
*
* Retrieve a stack
*
* @param string $stack_id The identifier of the stack. (required)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Stack|\InfluxDB2\Model\Error
*/
public function readStack($stack_id)
{
list($response) = $this->readStackWithHttpInfo($stack_id);
return $response;
}
/**
* Operation readStackWithHttpInfo
*
* Retrieve a stack
*
* @param string $stack_id The identifier of the stack. (required)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Stack|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function readStackWithHttpInfo($stack_id)
{
$request = $this->readStackRequest($stack_id);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Stack';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'readStack'
*
* @param string $stack_id The identifier of the stack. (required)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function readStackRequest($stack_id)
{
// verify the required parameter 'stack_id' is set
if ($stack_id === null || (is_array($stack_id) && count($stack_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $stack_id when calling readStack'
);
}
$resourcePath = '/api/v2/stacks/{stack_id}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($stack_id !== null) {
$resourcePath = str_replace(
'{' . 'stack_id' . '}',
ObjectSerializer::toPathValue($stack_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation uninstallStack
*
* Uninstall a stack
*
* @param string $stack_id The identifier of the stack. (required)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Stack|\InfluxDB2\Model\Error
*/
public function uninstallStack($stack_id)
{
list($response) = $this->uninstallStackWithHttpInfo($stack_id);
return $response;
}
/**
* Operation uninstallStackWithHttpInfo
*
* Uninstall a stack
*
* @param string $stack_id The identifier of the stack. (required)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Stack|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function uninstallStackWithHttpInfo($stack_id)
{
$request = $this->uninstallStackRequest($stack_id);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Stack';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'uninstallStack'
*
* @param string $stack_id The identifier of the stack. (required)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function uninstallStackRequest($stack_id)
{
// verify the required parameter 'stack_id' is set
if ($stack_id === null || (is_array($stack_id) && count($stack_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $stack_id when calling uninstallStack'
);
}
$resourcePath = '/api/v2/stacks/{stack_id}/uninstall';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($stack_id !== null) {
$resourcePath = str_replace(
'{' . 'stack_id' . '}',
ObjectSerializer::toPathValue($stack_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation updateStack
*
* Update a stack
*
* @param string $stack_id The identifier of the stack. (required)
* @param \InfluxDB2\Model\PatchStackRequest1 $patch_stack_request1 patch_stack_request1 (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\Stack|\InfluxDB2\Model\Error
*/
public function updateStack($stack_id, $patch_stack_request1 = null)
{
list($response) = $this->updateStackWithHttpInfo($stack_id, $patch_stack_request1);
return $response;
}
/**
* Operation updateStackWithHttpInfo
*
* Update a stack
*
* @param string $stack_id The identifier of the stack. (required)
* @param \InfluxDB2\Model\PatchStackRequest1 $patch_stack_request1 (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\Stack|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function updateStackWithHttpInfo($stack_id, $patch_stack_request1 = null)
{
$request = $this->updateStackRequest($stack_id, $patch_stack_request1);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Stack';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'updateStack'
*
* @param string $stack_id The identifier of the stack. (required)
* @param \InfluxDB2\Model\PatchStackRequest1 $patch_stack_request1 (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function updateStackRequest($stack_id, $patch_stack_request1 = null)
{
// verify the required parameter 'stack_id' is set
if ($stack_id === null || (is_array($stack_id) && count($stack_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $stack_id when calling updateStack'
);
}
$resourcePath = '/api/v2/stacks/{stack_id}';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($stack_id !== null) {
$resourcePath = str_replace(
'{' . 'stack_id' . '}',
ObjectSerializer::toPathValue($stack_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($patch_stack_request1)) {
$_tempBody = $patch_stack_request1;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('PATCH', $resourcePath, $httpBody, $headers, $queryParams);
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,354 @@
<?php
/**
* ViewsService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* ViewsService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class ViewsService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation getDashboardsIDCellsIDView
*
* Retrieve the view for a cell
*
* @param string $dashboard_id The dashboard ID. (required)
* @param string $cell_id The cell ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\View|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function getDashboardsIDCellsIDView($dashboard_id, $cell_id, $zap_trace_span = null)
{
list($response) = $this->getDashboardsIDCellsIDViewWithHttpInfo($dashboard_id, $cell_id, $zap_trace_span);
return $response;
}
/**
* Operation getDashboardsIDCellsIDViewWithHttpInfo
*
* Retrieve the view for a cell
*
* @param string $dashboard_id The dashboard ID. (required)
* @param string $cell_id The cell ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\View|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getDashboardsIDCellsIDViewWithHttpInfo($dashboard_id, $cell_id, $zap_trace_span = null)
{
$request = $this->getDashboardsIDCellsIDViewRequest($dashboard_id, $cell_id, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\View';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'getDashboardsIDCellsIDView'
*
* @param string $dashboard_id The dashboard ID. (required)
* @param string $cell_id The cell ID. (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function getDashboardsIDCellsIDViewRequest($dashboard_id, $cell_id, $zap_trace_span = null)
{
// verify the required parameter 'dashboard_id' is set
if ($dashboard_id === null || (is_array($dashboard_id) && count($dashboard_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $dashboard_id when calling getDashboardsIDCellsIDView'
);
}
// verify the required parameter 'cell_id' is set
if ($cell_id === null || (is_array($cell_id) && count($cell_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cell_id when calling getDashboardsIDCellsIDView'
);
}
$resourcePath = '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($dashboard_id !== null) {
$resourcePath = str_replace(
'{' . 'dashboardID' . '}',
ObjectSerializer::toPathValue($dashboard_id),
$resourcePath
);
}
// path params
if ($cell_id !== null) {
$resourcePath = str_replace(
'{' . 'cellID' . '}',
ObjectSerializer::toPathValue($cell_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('GET', $resourcePath, $httpBody, $headers, $queryParams);
}
/**
* Operation patchDashboardsIDCellsIDView
*
* Update the view for a cell
*
* @param string $dashboard_id The ID of the dashboard to update. (required)
* @param string $cell_id The ID of the cell to update. (required)
* @param \InfluxDB2\Model\View $view view (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \InfluxDB2\Model\View|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error
*/
public function patchDashboardsIDCellsIDView($dashboard_id, $cell_id, $view, $zap_trace_span = null)
{
list($response) = $this->patchDashboardsIDCellsIDViewWithHttpInfo($dashboard_id, $cell_id, $view, $zap_trace_span);
return $response;
}
/**
* Operation patchDashboardsIDCellsIDViewWithHttpInfo
*
* Update the view for a cell
*
* @param string $dashboard_id The ID of the dashboard to update. (required)
* @param string $cell_id The ID of the cell to update. (required)
* @param \InfluxDB2\Model\View $view (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \InfluxDB2\Model\View|\InfluxDB2\Model\Error|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function patchDashboardsIDCellsIDViewWithHttpInfo($dashboard_id, $cell_id, $view, $zap_trace_span = null)
{
$request = $this->patchDashboardsIDCellsIDViewRequest($dashboard_id, $cell_id, $view, $zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\View';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
}
/**
* Create request for operation 'patchDashboardsIDCellsIDView'
*
* @param string $dashboard_id The ID of the dashboard to update. (required)
* @param string $cell_id The ID of the cell to update. (required)
* @param \InfluxDB2\Model\View $view (required)
* @param string $zap_trace_span OpenTracing span context (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function patchDashboardsIDCellsIDViewRequest($dashboard_id, $cell_id, $view, $zap_trace_span = null)
{
// verify the required parameter 'dashboard_id' is set
if ($dashboard_id === null || (is_array($dashboard_id) && count($dashboard_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $dashboard_id when calling patchDashboardsIDCellsIDView'
);
}
// verify the required parameter 'cell_id' is set
if ($cell_id === null || (is_array($cell_id) && count($cell_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cell_id when calling patchDashboardsIDCellsIDView'
);
}
// verify the required parameter 'view' is set
if ($view === null || (is_array($view) && count($view) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $view when calling patchDashboardsIDCellsIDView'
);
}
$resourcePath = '/api/v2/dashboards/{dashboardID}/cells/{cellID}/view';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// path params
if ($dashboard_id !== null) {
$resourcePath = str_replace(
'{' . 'dashboardID' . '}',
ObjectSerializer::toPathValue($dashboard_id),
$resourcePath
);
}
// path params
if ($cell_id !== null) {
$resourcePath = str_replace(
'{' . 'cellID' . '}',
ObjectSerializer::toPathValue($cell_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($view)) {
$_tempBody = $view;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('PATCH', $resourcePath, $httpBody, $headers, $queryParams);
}
}
@@ -0,0 +1,237 @@
<?php
/**
* WriteService
* PHP version 5
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* InfluxDB OSS API Service
*
* The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.
*
* OpenAPI spec version: 2.0.0
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace InfluxDB2\Service;
use InfluxDB2\DefaultApi;
use InfluxDB2\HeaderSelector;
use InfluxDB2\ObjectSerializer;
/**
* WriteService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class WriteService
{
/**
* @var DefaultApi
*/
protected $defaultApi;
/**
* @var HeaderSelector
*/
protected $headerSelector;
/**
* @param DefaultApi $defaultApi
* @param HeaderSelector $selector
*/
public function __construct(DefaultApi $defaultApi)
{
$this->defaultApi = $defaultApi;
$this->headerSelector = new HeaderSelector();
}
/**
* Operation postWrite
*
* Write data
*
* @param string $org The destination organization for writes. InfluxDB writes all points in the batch to this organization. If you pass both &#x60;orgID&#x60; and &#x60;org&#x60;, they must both be valid. #### InfluxDB Cloud - Doesn&#39;t require &#x60;org&#x60; or &#x60;orgID&#x60;. - Writes to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. - InfluxDB writes all points in the batch to this organization. (required)
* @param string $bucket The destination bucket for writes. InfluxDB writes all points in the batch to this bucket. (required)
* @param string $body Data in line protocol format. To send compressed data, do the following: 1. Use [GZIP](https://www.gzip.org/) to compress the line protocol data. 2. In your request, send the compressed data and the &#x60;Content-Encoding: gzip&#x60; header. #### Related guides - [Best practices for optimizing writes](https://docs.influxdata.com/influxdb/v2.3/write-data/best-practices/optimize-writes/). (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_encoding The compression applied to the line protocol in the request payload. To send a GZIP payload, pass &#x60;Content-Encoding: gzip&#x60; header. (optional, default to 'identity')
* @param string $content_type The format of the data in the request body. To send a line protocol payload, pass &#x60;Content-Type: text/plain; charset&#x3D;utf-8&#x60;. (optional, default to 'text/plain; charset=utf-8')
* @param int $content_length The size of the entity-body, in bytes, sent to InfluxDB. If the length is greater than the &#x60;max body&#x60; configuration option, the server responds with status code &#x60;413&#x60;. (optional)
* @param string $accept The content type that the client can understand. Writes only return a response body if they fail--for example, due to a formatting problem or quota limit. #### InfluxDB Cloud - Returns only &#x60;application/json&#x60; for format and limit errors. - Returns only &#x60;text/html&#x60; for some quota limit errors. #### InfluxDB OSS - Returns only &#x60;application/json&#x60; for format and limit errors. #### Related guides - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/v2.3/write-data/troubleshoot/). (optional, default to 'application/json')
* @param string $org_id The ID of the destination organization for writes. If you pass both &#x60;orgID&#x60; and &#x60;org&#x60;, they must both be valid. #### InfluxDB Cloud - Doesn&#39;t require &#x60;org&#x60; or &#x60;orgID&#x60;. - Writes to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. - InfluxDB writes all points in the batch to this organization. (optional)
* @param \InfluxDB2\Model\WritePrecision $precision The precision for unix timestamps in the line protocol batch. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return void
*/
public function postWrite($org, $bucket, $body, $zap_trace_span = null, $content_encoding = 'identity', $content_type = 'text/plain; charset=utf-8', $content_length = null, $accept = 'application/json', $org_id = null, $precision = null)
{
$this->postWriteWithHttpInfo($org, $bucket, $body, $zap_trace_span, $content_encoding, $content_type, $content_length, $accept, $org_id, $precision);
}
/**
* Operation postWriteWithHttpInfo
*
* Write data
*
* @param string $org The destination organization for writes. InfluxDB writes all points in the batch to this organization. If you pass both &#x60;orgID&#x60; and &#x60;org&#x60;, they must both be valid. #### InfluxDB Cloud - Doesn&#39;t require &#x60;org&#x60; or &#x60;orgID&#x60;. - Writes to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. - InfluxDB writes all points in the batch to this organization. (required)
* @param string $bucket The destination bucket for writes. InfluxDB writes all points in the batch to this bucket. (required)
* @param string $body Data in line protocol format. To send compressed data, do the following: 1. Use [GZIP](https://www.gzip.org/) to compress the line protocol data. 2. In your request, send the compressed data and the &#x60;Content-Encoding: gzip&#x60; header. #### Related guides - [Best practices for optimizing writes](https://docs.influxdata.com/influxdb/v2.3/write-data/best-practices/optimize-writes/). (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_encoding The compression applied to the line protocol in the request payload. To send a GZIP payload, pass &#x60;Content-Encoding: gzip&#x60; header. (optional, default to 'identity')
* @param string $content_type The format of the data in the request body. To send a line protocol payload, pass &#x60;Content-Type: text/plain; charset&#x3D;utf-8&#x60;. (optional, default to 'text/plain; charset=utf-8')
* @param int $content_length The size of the entity-body, in bytes, sent to InfluxDB. If the length is greater than the &#x60;max body&#x60; configuration option, the server responds with status code &#x60;413&#x60;. (optional)
* @param string $accept The content type that the client can understand. Writes only return a response body if they fail--for example, due to a formatting problem or quota limit. #### InfluxDB Cloud - Returns only &#x60;application/json&#x60; for format and limit errors. - Returns only &#x60;text/html&#x60; for some quota limit errors. #### InfluxDB OSS - Returns only &#x60;application/json&#x60; for format and limit errors. #### Related guides - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/v2.3/write-data/troubleshoot/). (optional, default to 'application/json')
* @param string $org_id The ID of the destination organization for writes. If you pass both &#x60;orgID&#x60; and &#x60;org&#x60;, they must both be valid. #### InfluxDB Cloud - Doesn&#39;t require &#x60;org&#x60; or &#x60;orgID&#x60;. - Writes to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. - InfluxDB writes all points in the batch to this organization. (optional)
* @param \InfluxDB2\Model\WritePrecision $precision The precision for unix timestamps in the line protocol batch. (optional)
*
* @throws \InfluxDB2\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function postWriteWithHttpInfo($org, $bucket, $body, $zap_trace_span = null, $content_encoding = 'identity', $content_type = 'text/plain; charset=utf-8', $content_length = null, $accept = 'application/json', $org_id = null, $precision = null)
{
$request = $this->postWriteRequest($org, $bucket, $body, $zap_trace_span, $content_encoding, $content_type, $content_length, $accept, $org_id, $precision);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
}
/**
* Create request for operation 'postWrite'
*
* @param string $org The destination organization for writes. InfluxDB writes all points in the batch to this organization. If you pass both &#x60;orgID&#x60; and &#x60;org&#x60;, they must both be valid. #### InfluxDB Cloud - Doesn&#39;t require &#x60;org&#x60; or &#x60;orgID&#x60;. - Writes to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. - InfluxDB writes all points in the batch to this organization. (required)
* @param string $bucket The destination bucket for writes. InfluxDB writes all points in the batch to this bucket. (required)
* @param string $body Data in line protocol format. To send compressed data, do the following: 1. Use [GZIP](https://www.gzip.org/) to compress the line protocol data. 2. In your request, send the compressed data and the &#x60;Content-Encoding: gzip&#x60; header. #### Related guides - [Best practices for optimizing writes](https://docs.influxdata.com/influxdb/v2.3/write-data/best-practices/optimize-writes/). (required)
* @param string $zap_trace_span OpenTracing span context (optional)
* @param string $content_encoding The compression applied to the line protocol in the request payload. To send a GZIP payload, pass &#x60;Content-Encoding: gzip&#x60; header. (optional, default to 'identity')
* @param string $content_type The format of the data in the request body. To send a line protocol payload, pass &#x60;Content-Type: text/plain; charset&#x3D;utf-8&#x60;. (optional, default to 'text/plain; charset=utf-8')
* @param int $content_length The size of the entity-body, in bytes, sent to InfluxDB. If the length is greater than the &#x60;max body&#x60; configuration option, the server responds with status code &#x60;413&#x60;. (optional)
* @param string $accept The content type that the client can understand. Writes only return a response body if they fail--for example, due to a formatting problem or quota limit. #### InfluxDB Cloud - Returns only &#x60;application/json&#x60; for format and limit errors. - Returns only &#x60;text/html&#x60; for some quota limit errors. #### InfluxDB OSS - Returns only &#x60;application/json&#x60; for format and limit errors. #### Related guides - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/v2.3/write-data/troubleshoot/). (optional, default to 'application/json')
* @param string $org_id The ID of the destination organization for writes. If you pass both &#x60;orgID&#x60; and &#x60;org&#x60;, they must both be valid. #### InfluxDB Cloud - Doesn&#39;t require &#x60;org&#x60; or &#x60;orgID&#x60;. - Writes to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either &#x60;org&#x60; or &#x60;orgID&#x60;. - InfluxDB writes all points in the batch to this organization. (optional)
* @param \InfluxDB2\Model\WritePrecision $precision The precision for unix timestamps in the line protocol batch. (optional)
*
* @throws \InvalidArgumentException
* @return \Psr\Http\Message\RequestInterface
*/
protected function postWriteRequest($org, $bucket, $body, $zap_trace_span = null, $content_encoding = 'identity', $content_type = 'text/plain; charset=utf-8', $content_length = null, $accept = 'application/json', $org_id = null, $precision = null)
{
// verify the required parameter 'org' is set
if ($org === null || (is_array($org) && count($org) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $org when calling postWrite'
);
}
// verify the required parameter 'bucket' is set
if ($bucket === null || (is_array($bucket) && count($bucket) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $bucket when calling postWrite'
);
}
// verify the required parameter 'body' is set
if ($body === null || (is_array($body) && count($body) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $body when calling postWrite'
);
}
$resourcePath = '/api/v2/write';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($org !== null) {
$queryParams['org'] = ObjectSerializer::toQueryValue($org);
}
// query params
if ($org_id !== null) {
$queryParams['orgID'] = ObjectSerializer::toQueryValue($org_id);
}
// query params
if ($bucket !== null) {
$queryParams['bucket'] = ObjectSerializer::toQueryValue($bucket);
}
// query params
if ($precision !== null) {
$queryParams['precision'] = ObjectSerializer::toQueryValue($precision);
}
// header params
if ($zap_trace_span !== null) {
$headerParams['Zap-Trace-Span'] = ObjectSerializer::toHeaderValue($zap_trace_span);
}
// header params
if ($content_encoding !== null) {
$headerParams['Content-Encoding'] = ObjectSerializer::toHeaderValue($content_encoding);
}
// header params
if ($content_type !== null) {
$headerParams['Content-Type'] = ObjectSerializer::toHeaderValue($content_type);
}
// header params
if ($content_length !== null) {
$headerParams['Content-Length'] = ObjectSerializer::toHeaderValue($content_length);
}
// header params
if ($accept !== null) {
$headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept);
}
// body params
$_tempBody = null;
if (isset($body)) {
$_tempBody = $body;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json', 'text/html', ]
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json', 'text/html', ],
['text/plain']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
}
$headers = array_merge(
$headerParams,
$headers
);
return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);
}
}