InfluxDB PHP Client
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
InfluxDB2\Service\WriteService Class Reference

Public Member Functions

 __construct (DefaultApi $defaultApi)
 
 postWrite ($org, $bucket, $body, $zap_trace_span=null, $content_encoding='identity', $content_type='text/plain;charset=utf-8', $content_length=null, $accept='application/json', $org_id=null, $precision=null)
 
 postWriteWithHttpInfo ($org, $bucket, $body, $zap_trace_span=null, $content_encoding='identity', $content_type='text/plain;charset=utf-8', $content_length=null, $accept='application/json', $org_id=null, $precision=null)
 

Protected Member Functions

 postWriteRequest ($org, $bucket, $body, $zap_trace_span=null, $content_encoding='identity', $content_type='text/plain;charset=utf-8', $content_length=null, $accept='application/json', $org_id=null, $precision=null)
 

Protected Attributes

 $defaultApi
 
 $headerSelector
 

Constructor & Destructor Documentation

◆ __construct()

InfluxDB2\Service\WriteService::__construct ( DefaultApi $defaultApi)
Parameters
DefaultApi$defaultApi
HeaderSelector$selector

Member Function Documentation

◆ postWrite()

InfluxDB2\Service\WriteService::postWrite ( $org,
$bucket,
$body,
$zap_trace_span = null,
$content_encoding = 'identity',
$content_type = 'text/plain; charset=utf-8',
$content_length = null,
$accept = 'application/json',
$org_id = null,
$precision = null )

Operation postWrite

Write data

Parameters
string$orgThe destination organization for writes. InfluxDB writes all points in the batch to this organization. If you pass both `orgID` and `org`, they must both be valid. #### InfluxDB Cloud - Doesn't require `org` or `orgID`. - Writes to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either `org` or `orgID`. - InfluxDB writes all points in the batch to this organization. (required)
string$bucketThe destination bucket for writes. InfluxDB writes all points in the batch to this bucket. (required)
string$bodyData in line protocol format. To send compressed data, do the following: 1. Use GZIP to compress the line protocol data. 2. In your request, send the compressed data and the `Content-Encoding: gzip` header. #### Related guides - Best practices for optimizing writes. (required)
string$zap_trace_spanOpenTracing span context (optional)
string$content_encodingThe compression applied to the line protocol in the request payload. To send a GZIP payload, pass `Content-Encoding: gzip` header. (optional, default to 'identity')
string$content_typeThe format of the data in the request body. To send a line protocol payload, pass `Content-Type: text/plain; charset=utf-8`. (optional, default to 'text/plain; charset=utf-8')
int$content_lengthThe size of the entity-body, in bytes, sent to InfluxDB. If the length is greater than the `max body` configuration option, the server responds with status code `413`. (optional)
string$acceptThe content type that the client can understand. Writes only return a response body if they fail–for example, due to a formatting problem or quota limit. #### InfluxDB Cloud - Returns only `application/json` for format and limit errors. - Returns only `text/html` for some quota limit errors. #### InfluxDB OSS - Returns only `application/json` for format and limit errors. #### Related guides - Troubleshoot issues writing data. (optional, default to 'application/json')
string$org_idThe ID of the destination organization for writes. If you pass both `orgID` and `org`, they must both be valid. #### InfluxDB Cloud - Doesn't require `org` or `orgID`. - Writes to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either `org` or `orgID`. - InfluxDB writes all points in the batch to this organization. (optional)
\InfluxDB2\Model\WritePrecision$precisionThe precision for unix timestamps in the line protocol batch. (optional)
Exceptions

InfluxDB2\ApiException on non-2xx response

Exceptions

InvalidArgumentException

Returns
void

◆ postWriteRequest()

InfluxDB2\Service\WriteService::postWriteRequest ( $org,
$bucket,
$body,
$zap_trace_span = null,
$content_encoding = 'identity',
$content_type = 'text/plain; charset=utf-8',
$content_length = null,
$accept = 'application/json',
$org_id = null,
$precision = null )
protected

Create request for operation 'postWrite'

Parameters
string$orgThe destination organization for writes. InfluxDB writes all points in the batch to this organization. If you pass both `orgID` and `org`, they must both be valid. #### InfluxDB Cloud - Doesn't require `org` or `orgID`. - Writes to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either `org` or `orgID`. - InfluxDB writes all points in the batch to this organization. (required)
string$bucketThe destination bucket for writes. InfluxDB writes all points in the batch to this bucket. (required)
string$bodyData in line protocol format. To send compressed data, do the following: 1. Use GZIP to compress the line protocol data. 2. In your request, send the compressed data and the `Content-Encoding: gzip` header. #### Related guides - Best practices for optimizing writes. (required)
string$zap_trace_spanOpenTracing span context (optional)
string$content_encodingThe compression applied to the line protocol in the request payload. To send a GZIP payload, pass `Content-Encoding: gzip` header. (optional, default to 'identity')
string$content_typeThe format of the data in the request body. To send a line protocol payload, pass `Content-Type: text/plain; charset=utf-8`. (optional, default to 'text/plain; charset=utf-8')
int$content_lengthThe size of the entity-body, in bytes, sent to InfluxDB. If the length is greater than the `max body` configuration option, the server responds with status code `413`. (optional)
string$acceptThe content type that the client can understand. Writes only return a response body if they fail–for example, due to a formatting problem or quota limit. #### InfluxDB Cloud - Returns only `application/json` for format and limit errors. - Returns only `text/html` for some quota limit errors. #### InfluxDB OSS - Returns only `application/json` for format and limit errors. #### Related guides - Troubleshoot issues writing data. (optional, default to 'application/json')
string$org_idThe ID of the destination organization for writes. If you pass both `orgID` and `org`, they must both be valid. #### InfluxDB Cloud - Doesn't require `org` or `orgID`. - Writes to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either `org` or `orgID`. - InfluxDB writes all points in the batch to this organization. (optional)
\InfluxDB2\Model\WritePrecision$precisionThe precision for unix timestamps in the line protocol batch. (optional)
Exceptions

InvalidArgumentException

Returns
\Psr\Http\Message\RequestInterface

◆ postWriteWithHttpInfo()

InfluxDB2\Service\WriteService::postWriteWithHttpInfo ( $org,
$bucket,
$body,
$zap_trace_span = null,
$content_encoding = 'identity',
$content_type = 'text/plain; charset=utf-8',
$content_length = null,
$accept = 'application/json',
$org_id = null,
$precision = null )

Operation postWriteWithHttpInfo

Write data

Parameters
string$orgThe destination organization for writes. InfluxDB writes all points in the batch to this organization. If you pass both `orgID` and `org`, they must both be valid. #### InfluxDB Cloud - Doesn't require `org` or `orgID`. - Writes to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either `org` or `orgID`. - InfluxDB writes all points in the batch to this organization. (required)
string$bucketThe destination bucket for writes. InfluxDB writes all points in the batch to this bucket. (required)
string$bodyData in line protocol format. To send compressed data, do the following: 1. Use GZIP to compress the line protocol data. 2. In your request, send the compressed data and the `Content-Encoding: gzip` header. #### Related guides - Best practices for optimizing writes. (required)
string$zap_trace_spanOpenTracing span context (optional)
string$content_encodingThe compression applied to the line protocol in the request payload. To send a GZIP payload, pass `Content-Encoding: gzip` header. (optional, default to 'identity')
string$content_typeThe format of the data in the request body. To send a line protocol payload, pass `Content-Type: text/plain; charset=utf-8`. (optional, default to 'text/plain; charset=utf-8')
int$content_lengthThe size of the entity-body, in bytes, sent to InfluxDB. If the length is greater than the `max body` configuration option, the server responds with status code `413`. (optional)
string$acceptThe content type that the client can understand. Writes only return a response body if they fail–for example, due to a formatting problem or quota limit. #### InfluxDB Cloud - Returns only `application/json` for format and limit errors. - Returns only `text/html` for some quota limit errors. #### InfluxDB OSS - Returns only `application/json` for format and limit errors. #### Related guides - Troubleshoot issues writing data. (optional, default to 'application/json')
string$org_idThe ID of the destination organization for writes. If you pass both `orgID` and `org`, they must both be valid. #### InfluxDB Cloud - Doesn't require `org` or `orgID`. - Writes to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either `org` or `orgID`. - InfluxDB writes all points in the batch to this organization. (optional)
\InfluxDB2\Model\WritePrecision$precisionThe precision for unix timestamps in the line protocol batch. (optional)
Exceptions

InfluxDB2\ApiException on non-2xx response

Exceptions

InvalidArgumentException

Returns
array of null, HTTP status code, HTTP response headers (array of strings)

The documentation for this class was generated from the following file: