code
stringlengths 17
296k
| docstring
stringlengths 30
30.3k
| func_name
stringlengths 1
89
| language
stringclasses 1
value | repo
stringlengths 7
63
| path
stringlengths 7
153
| url
stringlengths 51
209
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
private function getRateLimitResetTime()
{
if (self::$rateLimitReset === null) {
return null;
}
return max(0, self::$rateLimitReset - time());
} | Get time until rate limit reset
@return int|null | getRateLimitResetTime | php | alihesari/laravel-social-auto-posting | src/Services/X/Api.php | https://github.com/alihesari/laravel-social-auto-posting/blob/master/src/Services/X/Api.php | MIT |
private function retryWithBackoff($callback, $attempt = 0)
{
try {
return $callback();
} catch (XApiException $e) {
if ($attempt >= self::MAX_RETRIES) {
throw $e;
}
$delay = self::BASE_DELAY * pow(2, $attempt);
sleep($delay);
return $this->retryWithBackoff($callback, $attempt + 1);
}
} | Implement exponential backoff retry logic
@param callable $callback
@param int $attempt
@return mixed
@throws XApiException | retryWithBackoff | php | alihesari/laravel-social-auto-posting | src/Services/X/Api.php | https://github.com/alihesari/laravel-social-auto-posting/blob/master/src/Services/X/Api.php | MIT |
public static function isDebugMode()
{
return self::$debug_mode;
} | Check if debug mode is enabled
@return bool | isDebugMode | php | alihesari/laravel-social-auto-posting | src/Services/Facebook/Api.php | https://github.com/alihesari/laravel-social-auto-posting/blob/master/src/Services/Facebook/Api.php | MIT |
private static function verifyPageAccess()
{
try {
$pageId = Config::get('larasap.facebook.page_id');
// First verify the page access token
$response = Http::get('https://graph.facebook.com/debug_token', [
'input_token' => self::$page_access_token,
'access_token' => self::$app_id . '|' . self::$app_secret
]);
if (!$response->successful()) {
throw new \Exception('Invalid page access token: ' . $response->body());
}
$tokenData = $response->json();
if (self::$debug_mode) {
Log::debug('Token debug data:', $tokenData);
}
// Verify page permissions
$response = Http::withToken(self::$page_access_token)
->get('https://graph.facebook.com/' . self::$default_graph_version . '/' . $pageId . '/permissions');
if (!$response->successful()) {
throw new \Exception('Could not verify page permissions: ' . $response->body());
}
$permissions = $response->json();
if (self::$debug_mode) {
Log::debug('Page permissions:', $permissions);
}
return true;
} catch (\Exception $e) {
if (self::$debug_mode) {
Log::error('Page access verification failed:', [
'message' => $e->getMessage(),
'trace' => $e->getTraceAsString()
]);
}
throw new \Exception('Failed to verify page access: ' . $e->getMessage());
}
} | Verify page access and permissions
@return bool
@throws \Exception | verifyPageAccess | php | alihesari/laravel-social-auto-posting | src/Services/Facebook/Api.php | https://github.com/alihesari/laravel-social-auto-posting/blob/master/src/Services/Facebook/Api.php | MIT |
public function __construct(
int $maxRetries = 5,
int $retryInterval = 5000,
int $maxRetryDelay = 125000,
int $exponentialBase = 2,
int $maxRetryTime = 180000,
int $jitterInterval = 0,
array $options = []
) {
$this->maxRetries = $maxRetries;
$this->retryInterval = $retryInterval;
$this->maxRetryDelay = $maxRetryDelay;
$this->maxRetryTime = $maxRetryTime;
$this->exponentialBase = $exponentialBase;
$this->jitterInterval = $jitterInterval;
$this->options = $options;
//retry timout
$this->retryTimout = microtime(true) * 1000 + $maxRetryTime;
} | WriteRetry constructor.
@param int $maxRetries max number of retries when write fails
@param int $retryInterval number of milliseconds to retry unsuccessful write,
The retry interval is used when the InfluxDB server does not specify "Retry-After" header.
@param int $maxRetryDelay maximum delay when retrying write in milliseconds
@param int $exponentialBase the base for the exponential retry delay, the next delay is computed using
random exponential backoff as a random value within the interval
``retryInterval * exponentialBase^(attempts-1)`` and
``retryInterval * exponentialBase^(attempts)``.
Example for ``retryInterval=5000, exponentialBase=2, maxRetryDelay=125000, total=5``
Retry delays are random distributed values within the ranges of
``[5000-10000, 10000-20000, 20000-40000, 40000-80000, 80000-125000]``
@param int $maxRetryTime maximum total time when retrying write in milliseconds
@param int $jitterInterval the number of milliseconds before the data is written increased by a random amount
@param array $options Client options with logFile. | __construct | php | influxdata/influxdb-client-php | src/InfluxDB2/WriteRetry.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/WriteRetry.php | MIT |
public function __construct(string $string)
{
parent::__construct($string);
} | FluxCsvParserException constructor.
@param string $string | __construct | php | influxdata/influxdb-client-php | src/InfluxDB2/FluxCsvParserException.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/FluxCsvParserException.php | MIT |
public function write($data, string $precision = null, string $bucket = null, string $org = null)
{
$precisionParam = $this->getOption("precision", $precision);
$bucketParam = $this->getOption("bucket", $bucket);
$orgParam = $this->getOption("org", $org);
$this->check("precision", $precisionParam);
$this->check("bucket", $bucketParam);
$this->check("org", $orgParam);
$this->addDefaultTags($data);
$payload = WritePayloadSerializer::generatePayload($data, $precisionParam, $bucketParam, $orgParam, $this->writeOptions->writeType);
if ($payload == null) {
return;
}
if (WriteType::BATCHING == $this->writeOptions->writeType) {
$this->worker()->push($payload);
} else {
$this->writeRaw($payload, $precisionParam, $bucketParam, $orgParam);
}
} | Write data into specified bucket
Example write data in array
$writeApi->write([
['name' => 'cpu','tags' => ['host' => 'server_nl', 'region' => 'us'],
'fields' => ['internal' => 5, 'external' => 6],
'time' => 1422568543702900257],
['name' => 'gpu', 'fields' => ['value' => 0.9999]]],
WritePrecision::NS,
'my-bucket',
'my-org'
)
Example write data in line protocol
$writeApi->write('h2o,location=west value=33i 15')
Example write data using Point structure
$point = new Point("h2o).
@param string|Point|array $data DataPoints to write into InfluxDB. The data could be represent by
array, Point, string
@param string|null $precision The precision for the unix timestamps within the body line-protocol @see \InfluxDB2\Model\WritePrecision
@param string|null $bucket specifies the destination bucket for writes
@param string|null $org specifies the destination organization for writes
@throws ApiException | write | php | influxdata/influxdb-client-php | src/InfluxDB2/WriteApi.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/WriteApi.php | MIT |
public function __construct(array $options, InvokableScriptsService $service)
{
parent::__construct($options);
$this->service = $service;
} | InvokableScriptsApi constructor.
@param array $options default array options
@param InvokableScriptsService $service HTTP API for Invokable Scripts | __construct | php | influxdata/influxdb-client-php | src/InfluxDB2/InvokableScriptsApi.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/InvokableScriptsApi.php | MIT |
protected function getSocket()
{
if (empty($this->socket)) {
$this->socket = socket_create($this->getConfiguredInetVersion(), SOCK_DGRAM, SOL_UDP);
}
return $this->socket;
} | Create (if not exists) socket to write UDP datagrams
@return false|resource
@throws \Exception | getSocket | php | influxdata/influxdb-client-php | src/InfluxDB2/UdpWriter.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/UdpWriter.php | MIT |
public static function generatePayload($data, ?string $precision = null, ?string $bucket = null, ?string $org = null, ?int $writeType = null)
{
if ($data == null || empty($data)) {
return null;
}
if (is_string($data)) {
if (WriteType::BATCHING == $writeType) {
return new BatchItem(new BatchItemKey($bucket, $org, $precision), $data);
} else {
return $data;
}
}
if ($data instanceof Point) {
return self::generatePayload($data->toLineProtocol(), $data->getPrecision() !== null ?
$data->getPrecision() : $precision, $bucket, $org, $writeType);
}
if (is_array($data)) {
if (array_key_exists('name', $data)) {
return self::generatePayload(Point::fromArray($data), $precision, $bucket, $org, $writeType);
}
$payload = '';
foreach ($data as $item) {
if (isset($item)) {
$payload .= self::generatePayload($item, $precision, $bucket, $org, $writeType) . "\n";
}
}
// remove last new line
if (isset($payload) && trim($payload) !== '') {
$payload = rtrim($payload, "\n");
}
return $payload;
}
return null;
} | Generate payload from provided data.
@param $data string|Point|array to generate payload
@param string|null $precision the precision used as a key for Batch
@param string|null $bucket the bucket used as a key for Batch
@param string|null $org the org used as a key for Batch
@param int|null $writeType specify type of writes - WriteType::SYNCHRONOUS or WriteType::BATCHING
@return BatchItem|string|null | generatePayload | php | influxdata/influxdb-client-php | src/InfluxDB2/WritePayloadSerializer.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/WritePayloadSerializer.php | MIT |
public static function sanitizeFilename($filename)
{
if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) {
return $match[1];
} else {
return $filename;
}
} | Sanitize filename by removing path.
e.g. ../../sun.gif becomes sun.gif
@param string $filename filename to be sanitized
@return string the sanitized filename | sanitizeFilename | php | influxdata/influxdb-client-php | src/InfluxDB2/ObjectSerializer.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/ObjectSerializer.php | MIT |
public static function toPathValue($value)
{
return rawurlencode(self::toString($value));
} | Take value and turn it into a string suitable for inclusion in
the path, by url-encoding.
@param string $value a string which will be part of the path
@return string the serialized object | toPathValue | php | influxdata/influxdb-client-php | src/InfluxDB2/ObjectSerializer.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/ObjectSerializer.php | MIT |
public static function toQueryValue($object)
{
if (is_array($object)) {
return implode(',', $object);
} else {
return self::toString($object);
}
} | Take value and turn it into a string suitable for inclusion in
the query, by imploding comma-separated if it's an object.
If it's a string, pass through unchanged. It will be url-encoded
later.
@param string[]|string|\DateTime $object an object to be serialized to a string
@return string the serialized object | toQueryValue | php | influxdata/influxdb-client-php | src/InfluxDB2/ObjectSerializer.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/ObjectSerializer.php | MIT |
public static function toHeaderValue($value)
{
return self::toString($value);
} | Take value and turn it into a string suitable for inclusion in
the header. If it's a string, pass through unchanged
If it's a datetime object, format it in ISO8601
@param string $value a string which will be part of the header
@return string the header string | toHeaderValue | php | influxdata/influxdb-client-php | src/InfluxDB2/ObjectSerializer.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/ObjectSerializer.php | MIT |
public static function toFormValue($value)
{
if ($value instanceof \SplFileObject) {
return $value->getRealPath();
} else {
return self::toString($value);
}
} | Take value and turn it into a string suitable for inclusion in
the http body (form parameter). If it's a string, pass through unchanged
If it's a datetime object, format it in ISO8601
@param string|\SplFileObject $value the value of the form parameter
@return string the form string | toFormValue | php | influxdata/influxdb-client-php | src/InfluxDB2/ObjectSerializer.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/ObjectSerializer.php | MIT |
public static function toString($value)
{
if ($value instanceof \DateTime) { // datetime in ISO8601 format
return $value->format(\DateTime::ATOM);
} else {
return $value;
}
} | Take value and turn it into a string suitable for inclusion in
the parameter. If it's a string, pass through unchanged
If it's a datetime object, format it in ISO8601
@param string|\DateTime $value the value of the parameter
@return string the header string | toString | php | influxdata/influxdb-client-php | src/InfluxDB2/ObjectSerializer.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/ObjectSerializer.php | MIT |
public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false)
{
if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) {
// http_build_query() almost does the job for us. We just
// need to fix the result of multidimensional arrays.
return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&'));
}
switch ($collectionFormat) {
case 'pipes':
return implode('|', $collection);
case 'tsv':
return implode("\t", $collection);
case 'ssv':
return implode(' ', $collection);
case 'csv':
// Deliberate fall through. CSV is default format.
default:
return implode(',', $collection);
}
} | Serialize an array to a string.
@param array $collection collection to serialize to a string
@param string $collectionFormat the format use for serialization (csv,
ssv, tsv, pipes, multi)
@param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array
@return string | serializeCollection | php | influxdata/influxdb-client-php | src/InfluxDB2/ObjectSerializer.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/ObjectSerializer.php | MIT |
public function setApiKeyPrefix($apiKeyIdentifier, $prefix)
{
$this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix;
return $this;
} | Sets the prefix for API key (e.g. Bearer)
@param string $apiKeyIdentifier API key identifier (authentication scheme)
@param string $prefix API key prefix, e.g. Bearer
@return $this | setApiKeyPrefix | php | influxdata/influxdb-client-php | src/InfluxDB2/Configuration.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Configuration.php | MIT |
public function setAccessToken($accessToken)
{
$this->accessToken = $accessToken;
return $this;
} | Sets the access token for OAuth
@param string $accessToken Token for OAuth
@return $this | setAccessToken | php | influxdata/influxdb-client-php | src/InfluxDB2/Configuration.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Configuration.php | MIT |
public function getAccessToken()
{
return $this->accessToken;
} | Gets the access token for OAuth
@return string Access token for OAuth | getAccessToken | php | influxdata/influxdb-client-php | src/InfluxDB2/Configuration.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Configuration.php | MIT |
public function setUsername($username)
{
$this->username = $username;
return $this;
} | Sets the username for HTTP basic authentication
@param string $username Username for HTTP basic authentication
@return $this | setUsername | php | influxdata/influxdb-client-php | src/InfluxDB2/Configuration.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Configuration.php | MIT |
public function getUsername()
{
return $this->username;
} | Gets the username for HTTP basic authentication
@return string Username for HTTP basic authentication | getUsername | php | influxdata/influxdb-client-php | src/InfluxDB2/Configuration.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Configuration.php | MIT |
public function setPassword($password)
{
$this->password = $password;
return $this;
} | Sets the password for HTTP basic authentication
@param string $password Password for HTTP basic authentication
@return $this | setPassword | php | influxdata/influxdb-client-php | src/InfluxDB2/Configuration.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Configuration.php | MIT |
public function getPassword()
{
return $this->password;
} | Gets the password for HTTP basic authentication
@return string Password for HTTP basic authentication | getPassword | php | influxdata/influxdb-client-php | src/InfluxDB2/Configuration.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Configuration.php | MIT |
public function setUserAgent($userAgent)
{
if (!is_string($userAgent)) {
throw new \InvalidArgumentException('User-agent must be a string.');
}
$this->userAgent = $userAgent;
return $this;
} | Sets the user agent of the api client
@param string $userAgent the user agent of the api client
@throws \InvalidArgumentException
@return $this | setUserAgent | php | influxdata/influxdb-client-php | src/InfluxDB2/Configuration.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Configuration.php | MIT |
public function getUserAgent()
{
return $this->userAgent;
} | Gets the user agent of the api client
@return string user agent | getUserAgent | php | influxdata/influxdb-client-php | src/InfluxDB2/Configuration.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Configuration.php | MIT |
public static function getDefaultConfiguration()
{
if (self::$defaultConfiguration === null) {
self::$defaultConfiguration = new Configuration();
}
return self::$defaultConfiguration;
} | Gets the default configuration instance
@return Configuration | getDefaultConfiguration | php | influxdata/influxdb-client-php | src/InfluxDB2/Configuration.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Configuration.php | MIT |
public static function setDefaultConfiguration(Configuration $config)
{
self::$defaultConfiguration = $config;
} | Sets the detault configuration instance
@param Configuration $config An instance of the Configuration Object
@return void | setDefaultConfiguration | php | influxdata/influxdb-client-php | src/InfluxDB2/Configuration.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Configuration.php | MIT |
public static function toDebugReport()
{
$report = 'PHP SDK (InfluxDB2) Debug Report:' . PHP_EOL;
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
$report .= ' OpenAPI Spec Version: 0.1.0' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
return $report;
} | Gets the essential information for debugging
@return string The report for debugging | toDebugReport | php | influxdata/influxdb-client-php | src/InfluxDB2/Configuration.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Configuration.php | MIT |
public function getApiKeyWithPrefix($apiKeyIdentifier)
{
$prefix = $this->getApiKeyPrefix($apiKeyIdentifier);
$apiKey = $this->getApiKey($apiKeyIdentifier);
if ($apiKey === null) {
return null;
}
if ($prefix === null) {
$keyWithPrefix = $apiKey;
} else {
$keyWithPrefix = $prefix . ' ' . $apiKey;
}
return $keyWithPrefix;
} | Get API key (with prefix if set)
@param string $apiKeyIdentifier name of apikey
@return string API key with the prefix | getApiKeyWithPrefix | php | influxdata/influxdb-client-php | src/InfluxDB2/Configuration.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Configuration.php | MIT |
public function getResponseBody()
{
return $this->responseBody;
} | Gets the HTTP body of the server response either as Json or string
@return mixed HTTP body of the server response either as \stdClass or string | getResponseBody | php | influxdata/influxdb-client-php | src/InfluxDB2/ApiException.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/ApiException.php | MIT |
public function setResponseObject($obj)
{
$this->responseObject = $obj;
} | Sets the deseralized response object (during deserialization)
@param mixed $obj Deserialized response object
@return void | setResponseObject | php | influxdata/influxdb-client-php | src/InfluxDB2/ApiException.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/ApiException.php | MIT |
public function getResponseObject()
{
return $this->responseObject;
} | Gets the deseralized response object (during deserialization)
@return mixed the deserialized response object | getResponseObject | php | influxdata/influxdb-client-php | src/InfluxDB2/ApiException.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/ApiException.php | MIT |
private function selectAcceptHeader($accept)
{
if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) {
return null;
} elseif (preg_grep("/application\/json/i", $accept)) {
return 'application/json';
} else {
return implode(',', $accept);
}
} | Return the header 'Accept' based on an array of Accept provided
@param string[] $accept Array of header
@return string Accept (e.g. application/json) | selectAcceptHeader | php | influxdata/influxdb-client-php | src/InfluxDB2/HeaderSelector.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/HeaderSelector.php | MIT |
private function selectContentTypeHeader($contentType)
{
if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) {
return 'application/json';
} elseif (preg_grep("/application\/json/i", $contentType)) {
return 'application/json';
} else {
return implode(',', $contentType);
}
} | Return the content type based on an array of content-type provided
@param string[] $contentType Array fo content-type
@return string Content-Type (e.g. application/json) | selectContentTypeHeader | php | influxdata/influxdb-client-php | src/InfluxDB2/HeaderSelector.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/HeaderSelector.php | MIT |
public function __construct(array $writeOptions = null)
{
//initialize with default values
$this->writeType = $writeOptions["writeType"] ?? WriteType::SYNCHRONOUS;
$this->batchSize = $writeOptions["batchSize"] ?? self::DEFAULT_BATCH_SIZE;
$this->retryInterval = $writeOptions["retryInterval"] ?? self::DEFAULT_RETRY_INTERVAL;
$this->maxRetries = $writeOptions["maxRetries"] ?? self::DEFAULT_MAX_RETRIES;
$this->maxRetryDelay = $writeOptions["maxRetryDelay"] ?? self::DEFAULT_MAX_RETRY_DELAY;
$this->maxRetryTime = $writeOptions["maxRetryTime"] ?? self::DEFAULT_MAX_RETRY_TIME;
$this->exponentialBase = $writeOptions["exponentialBase"] ?? self::DEFAULT_EXPONENTIAL_BASE;
$this->jitterInterval = $writeOptions["jitterInterval"] ?? self::DEFAULT_JITTER_INTERVAL;
} | WriteOptions constructor.
$writeOptions = [
'writeType' => methods of write (WriteType::SYNCHRONOUS - default, WriteType::BATCHING)
'batchSize' => the number of data point to collect in batch
'retryInterval' => number of milliseconds to retry unsuccessful write
'maxRetries' => max number of retries when write fails
The retry interval is used when the InfluxDB server does not specify "Retry-After" header.
'maxRetryDelay' => maximum delay when retrying write in milliseconds
'maxRetryTime' => maximum total time when retrying write in milliseconds
'exponentialBase' => the base for the exponential retry delay, the next delay is computed using
random exponential backoff as a random value within the interval
``retryInterval * exponentialBase^(attempts-1)`` and
``retryInterval * exponentialBase^(attempts)``.
Example for ``retryInterval=5000, exponentialBase=2, maxRetryDelay=125000, total=5``
Retry delays are random distributed values within the ranges of
``[5000-10000, 10000-20000, 20000-40000, 40000-80000, 80000-125000]``
'jitterInterval' => the number of milliseconds before the data is written increased by a random amount
]
@param array|null $writeOptions Array containing the write parameters (See above) | __construct | php | influxdata/influxdb-client-php | src/InfluxDB2/WriteOptions.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/WriteOptions.php | MIT |
public function __construct(
$name,
$tags = null,
$fields = null,
$time = null,
$precision = Point::DEFAULT_WRITE_PRECISION
) {
$this->name = $name;
$this->tags = $tags;
$this->fields = $fields;
$this->time = $time;
$this->precision = $precision;
} | Create DataPoint instance for specified measurement name.
@param [String] name the measurement name for the point.
@param [Array] tags the tag set for the point
@param [Array] fields the fields for the point
@param [Integer] time the timestamp for the point
@param [WritePrecision] precision the precision for the unix timestamps within the body line-protocol | __construct | php | influxdata/influxdb-client-php | src/InfluxDB2/Point.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Point.php | MIT |
public function toLineProtocol()
{
$measurement = $this->escapeKey($this->name, false);
$lineProtocol = $measurement;
$tags = $this->appendTags();
if (!$this->isNullOrEmptyString($tags)) {
$lineProtocol .= $tags;
} else {
$lineProtocol .= ' ';
}
$fields = $this->appendFields();
if ($this->isNullOrEmptyString($fields)) {
return null;
}
$lineProtocol .= $fields;
$time = $this->appendTime();
if (!$this->isNullOrEmptyString($time)) {
$lineProtocol .= $time;
}
return $lineProtocol;
} | If there is no field then return null.
@return string representation of the point | toLineProtocol | php | influxdata/influxdb-client-php | src/InfluxDB2/Point.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Point.php | MIT |
public function createService($serviceClass)
{
try {
$class = new ReflectionClass($serviceClass);
$args = array(new DefaultApi($this->options));
return $class->newInstanceArgs($args);
} catch (ReflectionException $e) {
throw new RuntimeException($e);
}
} | Creates the instance of api service
@param $serviceClass
@return object service instance | createService | php | influxdata/influxdb-client-php | src/InfluxDB2/Client.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Client.php | MIT |
public function getSetup($zap_trace_span = null)
{
list($response) = $this->getSetupWithHttpInfo($zap_trace_span);
return $response;
} | 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 | getSetup | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/SetupService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/SetupService.php | MIT |
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()
];
} | 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) | getSetupWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/SetupService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/SetupService.php | MIT |
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);
} | Create request for operation 'getSetup'
@param string $zap_trace_span OpenTracing span context (optional)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | getSetupRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/SetupService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/SetupService.php | MIT |
public function postSetup($onboarding_request, $zap_trace_span = null)
{
list($response) = $this->postSetupWithHttpInfo($onboarding_request, $zap_trace_span);
return $response;
} | 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 | postSetup | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/SetupService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/SetupService.php | MIT |
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()
];
} | 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) | postSetupWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/SetupService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/SetupService.php | MIT |
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);
} | 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 | postSetupRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/SetupService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/SetupService.php | MIT |
public function getQuerySuggestions($zap_trace_span = null)
{
list($response) = $this->getQuerySuggestionsWithHttpInfo($zap_trace_span);
return $response;
} | 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 | getQuerySuggestions | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/QueryService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/QueryService.php | MIT |
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()
];
} | 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) | getQuerySuggestionsWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/QueryService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/QueryService.php | MIT |
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);
} | Create request for operation 'getQuerySuggestions'
@param string $zap_trace_span OpenTracing span context (optional)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | getQuerySuggestionsRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/QueryService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/QueryService.php | MIT |
public function getQuerySuggestionsName($name, $zap_trace_span = null)
{
list($response) = $this->getQuerySuggestionsNameWithHttpInfo($name, $zap_trace_span);
return $response;
} | 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 | getQuerySuggestionsName | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/QueryService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/QueryService.php | MIT |
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()
];
} | 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) | getQuerySuggestionsNameWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/QueryService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/QueryService.php | MIT |
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);
} | 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 | getQuerySuggestionsNameRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/QueryService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/QueryService.php | MIT |
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 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't use `org` or `orgID`. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either `org` or `orgID`. (optional)
@param string $org_id The ID of the organization executing the query. #### InfluxDB Cloud - Doesn't use `org` or `orgID`. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either `org` or `orgID`. (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 | postQuery | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/QueryService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/QueryService.php | MIT |
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()
];
} | 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't use `org` or `orgID`. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either `org` or `orgID`. (optional)
@param string $org_id The ID of the organization executing the query. #### InfluxDB Cloud - Doesn't use `org` or `orgID`. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either `org` or `orgID`. (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) | postQueryWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/QueryService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/QueryService.php | MIT |
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);
} | 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't use `org` or `orgID`. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either `org` or `orgID`. (optional)
@param string $org_id The ID of the organization executing the query. #### InfluxDB Cloud - Doesn't use `org` or `orgID`. - Queries the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either `org` or `orgID`. (optional)
@param \InfluxDB2\Model\Query $query Flux query or specification to execute (optional)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | postQueryRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/QueryService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/QueryService.php | MIT |
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 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 | postQueryAnalyze | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/QueryService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/QueryService.php | MIT |
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()
];
} | 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) | postQueryAnalyzeWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/QueryService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/QueryService.php | MIT |
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);
} | 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 | postQueryAnalyzeRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/QueryService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/QueryService.php | MIT |
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 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 | postQueryAst | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/QueryService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/QueryService.php | MIT |
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()
];
} | 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) | postQueryAstWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/QueryService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/QueryService.php | MIT |
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);
} | 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 | postQueryAstRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/QueryService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/QueryService.php | MIT |
public function getDebugPprofAllProfiles($zap_trace_span = null, $cpu = null)
{
list($response) = $this->getDebugPprofAllProfilesWithHttpInfo($zap_trace_span, $cpu);
return $response;
} | Operation getDebugPprofAllProfiles
Retrieve all runtime profiles
@param string $zap_trace_span OpenTracing span context (optional)
@param string $cpu Collects and returns CPU profiling data for the specified [duration](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#duration). (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return \SplFileObject|string | getDebugPprofAllProfiles | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofAllProfilesWithHttpInfo($zap_trace_span = null, $cpu = null)
{
$request = $this->getDebugPprofAllProfilesRequest($zap_trace_span, $cpu);
$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()
];
} | Operation getDebugPprofAllProfilesWithHttpInfo
Retrieve all runtime profiles
@param string $zap_trace_span OpenTracing span context (optional)
@param string $cpu Collects and returns CPU profiling data for the specified [duration](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#duration). (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return array of \SplFileObject|string, HTTP status code, HTTP response headers (array of strings) | getDebugPprofAllProfilesWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
protected function getDebugPprofAllProfilesRequest($zap_trace_span = null, $cpu = null)
{
$resourcePath = '/debug/pprof/all';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($cpu !== null) {
$queryParams['cpu'] = ObjectSerializer::toQueryValue($cpu);
}
// 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);
} | Create request for operation 'getDebugPprofAllProfiles'
@param string $zap_trace_span OpenTracing span context (optional)
@param string $cpu Collects and returns CPU profiling data for the specified [duration](https://docs.influxdata.com/influxdb/v2.3/reference/glossary/#duration). (optional)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | getDebugPprofAllProfilesRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofAllocs($zap_trace_span = null, $debug = null, $seconds = null)
{
list($response) = $this->getDebugPprofAllocsWithHttpInfo($zap_trace_span, $debug, $seconds);
return $response;
} | Operation getDebugPprofAllocs
Retrieve the memory allocations runtime profile
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text. The report contains comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return \SplFileObject|string | getDebugPprofAllocs | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofAllocsWithHttpInfo($zap_trace_span = null, $debug = null, $seconds = null)
{
$request = $this->getDebugPprofAllocsRequest($zap_trace_span, $debug, $seconds);
$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()
];
} | Operation getDebugPprofAllocsWithHttpInfo
Retrieve the memory allocations runtime profile
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text. The report contains comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return array of \SplFileObject|string, HTTP status code, HTTP response headers (array of strings) | getDebugPprofAllocsWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
protected function getDebugPprofAllocsRequest($zap_trace_span = null, $debug = null, $seconds = null)
{
$resourcePath = '/debug/pprof/allocs';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($debug !== null) {
$queryParams['debug'] = ObjectSerializer::toQueryValue($debug);
}
// query params
if ($seconds !== null) {
$queryParams['seconds'] = ObjectSerializer::toQueryValue($seconds);
}
// 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', 'text/plain', 'application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/octet-stream', '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);
} | Create request for operation 'getDebugPprofAllocs'
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text. The report contains comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | getDebugPprofAllocsRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofBlock($zap_trace_span = null, $debug = null, $seconds = null)
{
list($response) = $this->getDebugPprofBlockWithHttpInfo($zap_trace_span, $debug, $seconds);
return $response;
} | Operation getDebugPprofBlock
Retrieve the block runtime profile
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text. The report contains comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return \SplFileObject|string | getDebugPprofBlock | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofBlockWithHttpInfo($zap_trace_span = null, $debug = null, $seconds = null)
{
$request = $this->getDebugPprofBlockRequest($zap_trace_span, $debug, $seconds);
$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()
];
} | Operation getDebugPprofBlockWithHttpInfo
Retrieve the block runtime profile
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text. The report contains comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return array of \SplFileObject|string, HTTP status code, HTTP response headers (array of strings) | getDebugPprofBlockWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
protected function getDebugPprofBlockRequest($zap_trace_span = null, $debug = null, $seconds = null)
{
$resourcePath = '/debug/pprof/block';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($debug !== null) {
$queryParams['debug'] = ObjectSerializer::toQueryValue($debug);
}
// query params
if ($seconds !== null) {
$queryParams['seconds'] = ObjectSerializer::toQueryValue($seconds);
}
// 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', 'text/plain', 'application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/octet-stream', '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);
} | Create request for operation 'getDebugPprofBlock'
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text. The report contains comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | getDebugPprofBlockRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofCmdline($zap_trace_span = null)
{
list($response) = $this->getDebugPprofCmdlineWithHttpInfo($zap_trace_span);
return $response;
} | Operation getDebugPprofCmdline
Retrieve the command line invocation
@param string $zap_trace_span OpenTracing span context (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return string|string | getDebugPprofCmdline | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofCmdlineWithHttpInfo($zap_trace_span = null)
{
$request = $this->getDebugPprofCmdlineRequest($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()
];
} | Operation getDebugPprofCmdlineWithHttpInfo
Retrieve the command line invocation
@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) | getDebugPprofCmdlineWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
protected function getDebugPprofCmdlineRequest($zap_trace_span = null)
{
$resourcePath = '/debug/pprof/cmdline';
$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);
} | Create request for operation 'getDebugPprofCmdline'
@param string $zap_trace_span OpenTracing span context (optional)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | getDebugPprofCmdlineRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofGoroutine($zap_trace_span = null, $debug = null, $seconds = null)
{
list($response) = $this->getDebugPprofGoroutineWithHttpInfo($zap_trace_span, $debug, $seconds);
return $response;
} | Operation getDebugPprofGoroutine
Retrieve the goroutines runtime profile
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text with comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return \SplFileObject|string | getDebugPprofGoroutine | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofGoroutineWithHttpInfo($zap_trace_span = null, $debug = null, $seconds = null)
{
$request = $this->getDebugPprofGoroutineRequest($zap_trace_span, $debug, $seconds);
$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()
];
} | Operation getDebugPprofGoroutineWithHttpInfo
Retrieve the goroutines runtime profile
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text with comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return array of \SplFileObject|string, HTTP status code, HTTP response headers (array of strings) | getDebugPprofGoroutineWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
protected function getDebugPprofGoroutineRequest($zap_trace_span = null, $debug = null, $seconds = null)
{
$resourcePath = '/debug/pprof/goroutine';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($debug !== null) {
$queryParams['debug'] = ObjectSerializer::toQueryValue($debug);
}
// query params
if ($seconds !== null) {
$queryParams['seconds'] = ObjectSerializer::toQueryValue($seconds);
}
// 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', 'text/plain', 'application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/octet-stream', '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);
} | Create request for operation 'getDebugPprofGoroutine'
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text with comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | getDebugPprofGoroutineRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofHeap($zap_trace_span = null, $debug = null, $seconds = null, $gc = null)
{
list($response) = $this->getDebugPprofHeapWithHttpInfo($zap_trace_span, $debug, $seconds, $gc);
return $response;
} | Operation getDebugPprofHeap
Retrieve the heap runtime profile
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text. The report contains comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@param int $gc - `0`: (Default) don't force garbage collection before sampling. - `1`: Force garbage collection before sampling. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return \SplFileObject|string | getDebugPprofHeap | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofHeapWithHttpInfo($zap_trace_span = null, $debug = null, $seconds = null, $gc = null)
{
$request = $this->getDebugPprofHeapRequest($zap_trace_span, $debug, $seconds, $gc);
$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()
];
} | Operation getDebugPprofHeapWithHttpInfo
Retrieve the heap runtime profile
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text. The report contains comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@param int $gc - `0`: (Default) don't force garbage collection before sampling. - `1`: Force garbage collection before sampling. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return array of \SplFileObject|string, HTTP status code, HTTP response headers (array of strings) | getDebugPprofHeapWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
protected function getDebugPprofHeapRequest($zap_trace_span = null, $debug = null, $seconds = null, $gc = null)
{
$resourcePath = '/debug/pprof/heap';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($debug !== null) {
$queryParams['debug'] = ObjectSerializer::toQueryValue($debug);
}
// query params
if ($seconds !== null) {
$queryParams['seconds'] = ObjectSerializer::toQueryValue($seconds);
}
// query params
if ($gc !== null) {
$queryParams['gc'] = ObjectSerializer::toQueryValue($gc);
}
// 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', 'text/plain', 'application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/octet-stream', '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);
} | Create request for operation 'getDebugPprofHeap'
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text. The report contains comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@param int $gc - `0`: (Default) don't force garbage collection before sampling. - `1`: Force garbage collection before sampling. (optional)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | getDebugPprofHeapRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofMutex($zap_trace_span = null, $debug = null, $seconds = null)
{
list($response) = $this->getDebugPprofMutexWithHttpInfo($zap_trace_span, $debug, $seconds);
return $response;
} | Operation getDebugPprofMutex
Retrieve the mutual exclusion (mutex) runtime profile
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text. The report contains comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return \SplFileObject|string | getDebugPprofMutex | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofMutexWithHttpInfo($zap_trace_span = null, $debug = null, $seconds = null)
{
$request = $this->getDebugPprofMutexRequest($zap_trace_span, $debug, $seconds);
$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()
];
} | Operation getDebugPprofMutexWithHttpInfo
Retrieve the mutual exclusion (mutex) runtime profile
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text. The report contains comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return array of \SplFileObject|string, HTTP status code, HTTP response headers (array of strings) | getDebugPprofMutexWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
protected function getDebugPprofMutexRequest($zap_trace_span = null, $debug = null, $seconds = null)
{
$resourcePath = '/debug/pprof/mutex';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($debug !== null) {
$queryParams['debug'] = ObjectSerializer::toQueryValue($debug);
}
// query params
if ($seconds !== null) {
$queryParams['seconds'] = ObjectSerializer::toQueryValue($seconds);
}
// 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', 'text/plain', 'application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/octet-stream', '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);
} | Create request for operation 'getDebugPprofMutex'
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text. The report contains comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | getDebugPprofMutexRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofProfile($zap_trace_span = null, $seconds = null)
{
list($response) = $this->getDebugPprofProfileWithHttpInfo($zap_trace_span, $seconds);
return $response;
} | Operation getDebugPprofProfile
Retrieve the CPU runtime profile
@param string $zap_trace_span OpenTracing span context (optional)
@param string $seconds Number of seconds to collect profile data. Default is `30` seconds. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return \SplFileObject|string | getDebugPprofProfile | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofProfileWithHttpInfo($zap_trace_span = null, $seconds = null)
{
$request = $this->getDebugPprofProfileRequest($zap_trace_span, $seconds);
$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()
];
} | Operation getDebugPprofProfileWithHttpInfo
Retrieve the CPU runtime profile
@param string $zap_trace_span OpenTracing span context (optional)
@param string $seconds Number of seconds to collect profile data. Default is `30` seconds. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return array of \SplFileObject|string, HTTP status code, HTTP response headers (array of strings) | getDebugPprofProfileWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
protected function getDebugPprofProfileRequest($zap_trace_span = null, $seconds = null)
{
$resourcePath = '/debug/pprof/profile';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($seconds !== null) {
$queryParams['seconds'] = ObjectSerializer::toQueryValue($seconds);
}
// 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);
} | Create request for operation 'getDebugPprofProfile'
@param string $zap_trace_span OpenTracing span context (optional)
@param string $seconds Number of seconds to collect profile data. Default is `30` seconds. (optional)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | getDebugPprofProfileRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofThreadCreate($zap_trace_span = null, $debug = null, $seconds = null)
{
list($response) = $this->getDebugPprofThreadCreateWithHttpInfo($zap_trace_span, $debug, $seconds);
return $response;
} | Operation getDebugPprofThreadCreate
Retrieve the threadcreate runtime profile
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text. The report contains comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return \SplFileObject|string | getDebugPprofThreadCreate | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofThreadCreateWithHttpInfo($zap_trace_span = null, $debug = null, $seconds = null)
{
$request = $this->getDebugPprofThreadCreateRequest($zap_trace_span, $debug, $seconds);
$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()
];
} | Operation getDebugPprofThreadCreateWithHttpInfo
Retrieve the threadcreate runtime profile
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text. The report contains comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return array of \SplFileObject|string, HTTP status code, HTTP response headers (array of strings) | getDebugPprofThreadCreateWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
protected function getDebugPprofThreadCreateRequest($zap_trace_span = null, $debug = null, $seconds = null)
{
$resourcePath = '/debug/pprof/threadcreate';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($debug !== null) {
$queryParams['debug'] = ObjectSerializer::toQueryValue($debug);
}
// query params
if ($seconds !== null) {
$queryParams['seconds'] = ObjectSerializer::toQueryValue($seconds);
}
// 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', 'text/plain', 'application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/octet-stream', '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);
} | Create request for operation 'getDebugPprofThreadCreate'
@param string $zap_trace_span OpenTracing span context (optional)
@param int $debug - `0`: (Default) Return the report as a gzip-compressed protocol buffer. - `1`: Return a response body with the report formatted as human-readable text. The report contains comments that translate addresses to function names and line numbers for debugging. `debug=1` is mutually exclusive with the `seconds` query parameter. (optional)
@param string $seconds Number of seconds to collect statistics. `seconds` is mutually exclusive with `debug=1`. (optional)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | getDebugPprofThreadCreateRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofTrace($zap_trace_span = null, $seconds = null)
{
list($response) = $this->getDebugPprofTraceWithHttpInfo($zap_trace_span, $seconds);
return $response;
} | Operation getDebugPprofTrace
Retrieve the runtime execution trace
@param string $zap_trace_span OpenTracing span context (optional)
@param string $seconds Number of seconds to collect profile data. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return \SplFileObject|string | getDebugPprofTrace | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getDebugPprofTraceWithHttpInfo($zap_trace_span = null, $seconds = null)
{
$request = $this->getDebugPprofTraceRequest($zap_trace_span, $seconds);
$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()
];
} | Operation getDebugPprofTraceWithHttpInfo
Retrieve the runtime execution trace
@param string $zap_trace_span OpenTracing span context (optional)
@param string $seconds Number of seconds to collect profile data. (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return array of \SplFileObject|string, HTTP status code, HTTP response headers (array of strings) | getDebugPprofTraceWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
protected function getDebugPprofTraceRequest($zap_trace_span = null, $seconds = null)
{
$resourcePath = '/debug/pprof/trace';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($seconds !== null) {
$queryParams['seconds'] = ObjectSerializer::toQueryValue($seconds);
}
// 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);
} | Create request for operation 'getDebugPprofTrace'
@param string $zap_trace_span OpenTracing span context (optional)
@param string $seconds Number of seconds to collect profile data. (optional)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | getDebugPprofTraceRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/DebugService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/DebugService.php | MIT |
public function getReady($zap_trace_span = null)
{
list($response) = $this->getReadyWithHttpInfo($zap_trace_span);
return $response;
} | 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 | getReady | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/ReadyService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/ReadyService.php | MIT |
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()
];
} | 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) | getReadyWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/ReadyService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/ReadyService.php | MIT |
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);
} | Create request for operation 'getReady'
@param string $zap_trace_span OpenTracing span context (optional)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | getReadyRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/ReadyService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/ReadyService.php | MIT |
public function postSignout($zap_trace_span = null)
{
$this->postSignoutWithHttpInfo($zap_trace_span);
} | 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 | postSignout | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/SignoutService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/SignoutService.php | MIT |
public function postSignoutWithHttpInfo($zap_trace_span = null)
{
$request = $this->postSignoutRequest($zap_trace_span);
$response = $this->defaultApi->sendRequest($request);
return [null, $response->getStatusCode(), $response->getHeaders()];
} | 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) | postSignoutWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/SignoutService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/SignoutService.php | MIT |
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);
} | Create request for operation 'postSignout'
@param string $zap_trace_span OpenTracing span context (optional)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | postSignoutRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/SignoutService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/SignoutService.php | MIT |
public function createCheck($check)
{
list($response) = $this->createCheckWithHttpInfo($check);
return $response;
} | Operation createCheck
Add new check
@param \InfluxDB2\Model\Check $check Check to create (required)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return \InfluxDB2\Model\Check|\InfluxDB2\Model\Error | createCheck | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/ChecksService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/ChecksService.php | MIT |
public function createCheckWithHttpInfo($check)
{
$request = $this->createCheckRequest($check);
$response = $this->defaultApi->sendRequest($request);
$returnType = '\InfluxDB2\Model\Check';
$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()
];
} | Operation createCheckWithHttpInfo
Add new check
@param \InfluxDB2\Model\Check $check Check to create (required)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return array of \InfluxDB2\Model\Check|\InfluxDB2\Model\Error, HTTP status code, HTTP response headers (array of strings) | createCheckWithHttpInfo | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/ChecksService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/ChecksService.php | MIT |
protected function createCheckRequest($check)
{
// verify the required parameter 'check' is set
if ($check === null || (is_array($check) && count($check) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $check when calling createCheck'
);
}
$resourcePath = '/api/v2/checks';
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// body params
$_tempBody = null;
if (isset($check)) {
$_tempBody = $check;
}
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);
} | Create request for operation 'createCheck'
@param \InfluxDB2\Model\Check $check Check to create (required)
@throws \InvalidArgumentException
@return \Psr\Http\Message\RequestInterface | createCheckRequest | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/ChecksService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/ChecksService.php | MIT |
public function deleteChecksID($check_id, $zap_trace_span = null)
{
$this->deleteChecksIDWithHttpInfo($check_id, $zap_trace_span);
} | Operation deleteChecksID
Delete a check
@param string $check_id The check ID. (required)
@param string $zap_trace_span OpenTracing span context (optional)
@throws \InfluxDB2\ApiException on non-2xx response
@throws \InvalidArgumentException
@return void | deleteChecksID | php | influxdata/influxdb-client-php | src/InfluxDB2/Service/ChecksService.php | https://github.com/influxdata/influxdb-client-php/blob/master/src/InfluxDB2/Service/ChecksService.php | MIT |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.