Interface IWriteService
Represents a collection of functions to interact with the API endpoints
Namespace: InfluxDB.Client.Api.Service
Assembly: InfluxDB.Client.dll
Syntax
public interface IWriteService : IApiAccessor
Methods
PostWrite(String, String, Byte[], String, String, String, Nullable<Int32>, String, String, Nullable<WritePrecision>)
Write data
Declaration
void PostWrite(string org, string bucket, byte[] body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, int? contentLength = null, string accept = null, string orgID = null, WritePrecision? precision = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
org | The parameter value specifies the destination organization for writes. The database writes all points in the batch to this organization. If you provide both |
System. |
bucket | The destination bucket for writes. |
System. |
body | Data in line protocol format. |
System. |
zapTraceSpan | OpenTracing span context (optional) |
System. |
contentEncoding | The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send |
System. |
contentType | The header value indicates the format of the data in the request body. (optional, default to text/plain; charset=utf-8) |
System. |
contentLength | The header value indicates the size of the entity-body, in bytes, sent to the database. If the length is greater than the database's |
System. |
accept | The header value specifies the response format. (optional, default to application/json) |
System. |
orgID | The parameter value specifies the ID of the destination organization for writes. If both |
System. |
precision | The precision for the unix timestamps within the body line-protocol. (optional) |
Remarks
Writes data to a bucket. To write data into InfluxDB, you need the following: - organization name or ID – See View organizations for instructions on viewing your organization ID. - bucket – See View buckets for instructions on viewing your bucket ID. - API token – See View tokens for instructions on viewing your API token. - InfluxDB URL – See InfluxDB URLs. - data in line protocol format. InfluxDB Cloud enforces rate and size limits different from InfluxDB OSS. For details, see Responses. For more information and examples, see the following: - Write data with the InfluxDB API. - Optimize writes to InfluxDB.
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
PostWriteAsync(String, String, Byte[], String, String, String, Nullable<Int32>, String, String, Nullable<WritePrecision>, CancellationToken)
Write data
Declaration
System.Threading.Tasks.Task PostWriteAsync(string org, string bucket, byte[] body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, int? contentLength = null, string accept = null, string orgID = null, WritePrecision? precision = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
org | The parameter value specifies the destination organization for writes. The database writes all points in the batch to this organization. If you provide both |
System. |
bucket | The destination bucket for writes. |
System. |
body | Data in line protocol format. |
System. |
zapTraceSpan | OpenTracing span context (optional) |
System. |
contentEncoding | The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send |
System. |
contentType | The header value indicates the format of the data in the request body. (optional, default to text/plain; charset=utf-8) |
System. |
contentLength | The header value indicates the size of the entity-body, in bytes, sent to the database. If the length is greater than the database's |
System. |
accept | The header value specifies the response format. (optional, default to application/json) |
System. |
orgID | The parameter value specifies the ID of the destination organization for writes. If both |
System. |
precision | The precision for the unix timestamps within the body line-protocol. (optional) |
Cancellation |
cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
System. |
Task of void |
Remarks
Writes data to a bucket. To write data into InfluxDB, you need the following: - organization name or ID – See View organizations for instructions on viewing your organization ID. - bucket – See View buckets for instructions on viewing your bucket ID. - API token – See View tokens for instructions on viewing your API token. - InfluxDB URL – See InfluxDB URLs. - data in line protocol format. InfluxDB Cloud enforces rate and size limits different from InfluxDB OSS. For details, see Responses. For more information and examples, see the following: - Write data with the InfluxDB API. - Optimize writes to InfluxDB.
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
PostWriteAsyncWithHttpInfo(String, String, Byte[], String, String, String, Nullable<Int32>, String, String, Nullable<WritePrecision>, CancellationToken)
Write data
Declaration
System.Threading.Tasks.Task<ApiResponse<object>> PostWriteAsyncWithHttpInfo(string org, string bucket, byte[] body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, int? contentLength = null, string accept = null, string orgID = null, WritePrecision? precision = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
org | The parameter value specifies the destination organization for writes. The database writes all points in the batch to this organization. If you provide both |
System. |
bucket | The destination bucket for writes. |
System. |
body | Data in line protocol format. |
System. |
zapTraceSpan | OpenTracing span context (optional) |
System. |
contentEncoding | The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send |
System. |
contentType | The header value indicates the format of the data in the request body. (optional, default to text/plain; charset=utf-8) |
System. |
contentLength | The header value indicates the size of the entity-body, in bytes, sent to the database. If the length is greater than the database's |
System. |
accept | The header value specifies the response format. (optional, default to application/json) |
System. |
orgID | The parameter value specifies the ID of the destination organization for writes. If both |
System. |
precision | The precision for the unix timestamps within the body line-protocol. (optional) |
Cancellation |
cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
System. |
Task of ApiResponse |
Remarks
Writes data to a bucket. To write data into InfluxDB, you need the following: - organization name or ID – See View organizations for instructions on viewing your organization ID. - bucket – See View buckets for instructions on viewing your bucket ID. - API token – See View tokens for instructions on viewing your API token. - InfluxDB URL – See InfluxDB URLs. - data in line protocol format. InfluxDB Cloud enforces rate and size limits different from InfluxDB OSS. For details, see Responses. For more information and examples, see the following: - Write data with the InfluxDB API. - Optimize writes to InfluxDB.
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
PostWriteWithHttpInfo(String, String, Byte[], String, String, String, Nullable<Int32>, String, String, Nullable<WritePrecision>)
Write data
Declaration
ApiResponse<object> PostWriteWithHttpInfo(string org, string bucket, byte[] body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, int? contentLength = null, string accept = null, string orgID = null, WritePrecision? precision = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
org | The parameter value specifies the destination organization for writes. The database writes all points in the batch to this organization. If you provide both |
System. |
bucket | The destination bucket for writes. |
System. |
body | Data in line protocol format. |
System. |
zapTraceSpan | OpenTracing span context (optional) |
System. |
contentEncoding | The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send |
System. |
contentType | The header value indicates the format of the data in the request body. (optional, default to text/plain; charset=utf-8) |
System. |
contentLength | The header value indicates the size of the entity-body, in bytes, sent to the database. If the length is greater than the database's |
System. |
accept | The header value specifies the response format. (optional, default to application/json) |
System. |
orgID | The parameter value specifies the ID of the destination organization for writes. If both |
System. |
precision | The precision for the unix timestamps within the body line-protocol. (optional) |
Returns
Type | Description |
---|---|
Influx |
ApiResponse of Object(void) |
Remarks
Writes data to a bucket. To write data into InfluxDB, you need the following: - organization name or ID – See View organizations for instructions on viewing your organization ID. - bucket – See View buckets for instructions on viewing your bucket ID. - API token – See View tokens for instructions on viewing your API token. - InfluxDB URL – See InfluxDB URLs. - data in line protocol format. InfluxDB Cloud enforces rate and size limits different from InfluxDB OSS. For details, see Responses. For more information and examples, see the following: - Write data with the InfluxDB API. - Optimize writes to InfluxDB.
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |