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.String | 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.String | bucket | The destination bucket for writes. |
System.Byte[] | body | Data in line protocol format. |
System.String | zapTraceSpan | OpenTracing span context (optional) |
System.String | 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.String | contentType | The header value indicates the format of the data in the request body. (optional, default to text/plain; charset=utf-8) |
System.Nullable<System.Int32> | 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.String | accept | The header value specifies the response format. (optional, default to application/json) |
System.String | orgID | The parameter value specifies the ID of the destination organization for writes. If both |
System.Nullable<WritePrecision> | 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 |
---|---|
InfluxDB.Client.Api.Client.ApiException | 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.String | 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.String | bucket | The destination bucket for writes. |
System.Byte[] | body | Data in line protocol format. |
System.String | zapTraceSpan | OpenTracing span context (optional) |
System.String | 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.String | contentType | The header value indicates the format of the data in the request body. (optional, default to text/plain; charset=utf-8) |
System.Nullable<System.Int32> | 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.String | accept | The header value specifies the response format. (optional, default to application/json) |
System.String | orgID | The parameter value specifies the ID of the destination organization for writes. If both |
System.Nullable<WritePrecision> | precision | The precision for the unix timestamps within the body line-protocol. (optional) |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | 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 |
---|---|
InfluxDB.Client.Api.Client.ApiException | 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.String | 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.String | bucket | The destination bucket for writes. |
System.Byte[] | body | Data in line protocol format. |
System.String | zapTraceSpan | OpenTracing span context (optional) |
System.String | 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.String | contentType | The header value indicates the format of the data in the request body. (optional, default to text/plain; charset=utf-8) |
System.Nullable<System.Int32> | 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.String | accept | The header value specifies the response format. (optional, default to application/json) |
System.String | orgID | The parameter value specifies the ID of the destination organization for writes. If both |
System.Nullable<WritePrecision> | precision | The precision for the unix timestamps within the body line-protocol. (optional) |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<InfluxDB.Client.Api.Client.ApiResponse<System.Object>> | 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 |
---|---|
InfluxDB.Client.Api.Client.ApiException | 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.String | 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.String | bucket | The destination bucket for writes. |
System.Byte[] | body | Data in line protocol format. |
System.String | zapTraceSpan | OpenTracing span context (optional) |
System.String | 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.String | contentType | The header value indicates the format of the data in the request body. (optional, default to text/plain; charset=utf-8) |
System.Nullable<System.Int32> | 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.String | accept | The header value specifies the response format. (optional, default to application/json) |
System.String | orgID | The parameter value specifies the ID of the destination organization for writes. If both |
System.Nullable<WritePrecision> | precision | The precision for the unix timestamps within the body line-protocol. (optional) |
Returns
Type | Description |
---|---|
InfluxDB.Client.Api.Client.ApiResponse<System.Object> | 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 |
---|---|
InfluxDB.Client.Api.Client.ApiException | Thrown when fails to make API call |