Class WriteService
Represents a collection of functions to interact with the API endpoints
Inheritance
Implements
Namespace: InfluxDB.Client.Api.Service
Assembly: InfluxDB.Client.dll
Syntax
public class WriteService : object, IWriteService, IApiAccessor
Constructors
WriteService(Configuration)
Initializes a new instance of the Write
Declaration
public WriteService(Configuration configuration = null)
Parameters
Type | Name | Description |
---|---|---|
Influx |
configuration | An instance of Configuration |
WriteService(String)
Initializes a new instance of the Write
Declaration
public WriteService(string basePath)
Parameters
Type | Name | Description |
---|---|---|
System. |
basePath |
Properties
Configuration
Gets or sets the configuration object
Declaration
public Configuration Configuration { get; set; }
Property Value
Type | Description |
---|---|
Influx |
An instance of the Configuration |
ExceptionFactory
Provides a factory method hook for the creation of exceptions.
Declaration
public ExceptionFactory ExceptionFactory { get; set; }
Property Value
Type | Description |
---|---|
Influx |
Methods
AddDefaultHeader(String, String)
Add default header.
Declaration
public void AddDefaultHeader(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | Header field name. |
System. |
value | Header field value. |
DefaultHeader()
Gets the default header.
Declaration
public IDictionary<string, string> DefaultHeader()
Returns
Type | Description |
---|---|
IDictionary<System. |
Dictionary of HTTP header |
GetBasePath()
Gets the base path of the API client.
Declaration
public string GetBasePath()
Returns
Type | Description |
---|---|
System. |
The base path |
PostWrite(String, String, Byte[], String, String, String, Nullable<Int32>, String, String, Nullable<WritePrecision>)
Write data 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.
Declaration
public 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) |
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 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.
Declaration
public 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 |
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 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.
Declaration
public async 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 |
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
PostWriteAsyncWithIRestResponse(String, String, Byte[], String, String, String, Nullable<Int32>, String, String, Nullable<WritePrecision>, CancellationToken)
Write data 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.
Declaration
public async System.Threading.Tasks.Task<RestResponse> PostWriteAsyncWithIRestResponse(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 RestResponse |
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 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.
Declaration
public 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) |
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
PostWriteWithIRestResponse(String, String, Byte[], String, String, String, Nullable<Int32>, String, String, Nullable<WritePrecision>)
Write data 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.
Declaration
public RestResponse PostWriteWithIRestResponse(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 |
---|---|
Rest |
ApiResponse of Object(void) |
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
PostWriteWithIRestResponseAsync(String, String, Byte[], String, String, String, Nullable<Int32>, String, String, Nullable<WritePrecision>, CancellationToken)
Write data 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.
Declaration
public async System.Threading.Tasks.Task<RestResponse> PostWriteWithIRestResponseAsync(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. |
ApiResponse of Object(void) |
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
PostWriteWithRestRequest(String, String, Byte[], String, String, String, Nullable<Int32>, String, String, Nullable<WritePrecision>)
Write data 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.
Declaration
public RestRequest PostWriteWithRestRequest(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 |
---|---|
Rest |
ApiResponse of Object(void) |
Exceptions
Type | Condition |
---|---|
Influx |
Thrown when fails to make API call |
SetBasePath(String)
Sets the base path of the API client.
Declaration
public void SetBasePath(string basePath)
Parameters
Type | Name | Description |
---|---|---|
System. |
basePath |