> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# create_datasource

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_datasource.rs#L28-L43)
pub async fn [create\_datasource](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-datasource.md#method.create_datasource)( \&self, name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), location: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), user\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), password: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateDatasourceResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasourceResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Create a data sourceCreates a data source, which contains the location and connection information for a data store that is external to the database.

##### Arguments

<ul>
  <li>
    `name` - Name of the data source to be created.
  </li>

  <li>
    `location` - Location of the remote storage in ‘storage\_provider\_type://\[storage\_path\[:storage\_port]]’ format.Supported storage provider types are ‘azure’, ‘gcs’, ‘hdfs’, ‘jdbc’, ‘kafka’, ‘confluent’, and ‘s3’.
  </li>

  <li>
    `user_name` - Name of the remote system user; may be an empty string.
  </li>

  <li>
    `password` - Password for the remote system user; may be an empty string.
  </li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_datasource.rs#L63-L85)
pub async fn [create\_datasource\_with\_opts](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-datasource.md#method.create_datasource_with_opts)( \&self, name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), location: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), user\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), password: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), options: [CreateDatasourceRequestOptions](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasourceRequestOptions.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateDatasourceResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasourceResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Create a data sourceCreates a data source, which contains the location and connection information for a data store that is external to the database.

##### Arguments

<ul>
  <li>
    `name` - Name of the data source to be created.
  </li>

  <li>
    `location` - Location of the remote storage in ‘storage\_provider\_type://\[storage\_path\[:storage\_port]]’ format.Supported storage provider types are ‘azure’, ‘gcs’, ‘hdfs’, ‘jdbc’, ‘kafka’, ‘confluent’, and ‘s3’.
  </li>

  <li>
    `user_name` - Name of the remote system user; may be an empty string.
  </li>

  <li>
    `password` - Password for the remote system user; may be an empty string.
  </li>

  <li>
    `options` - The optional parameters; any left unset take the server’s defaults.
  </li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_datasource.rs#L88-L99)
pub async fn [create\_datasource\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-datasource.md#method.create_datasource_raw)( \&self, request: &[CreateDatasourceRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasourceRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateDatasourceResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasourceResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`CreateDatasourceRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasourceRequest) to the `/create/datasource` endpoint.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_datasource.rs#L103-L115)
pub async fn [create\_datasource\_from\_url](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-datasource.md#method.create_datasource_from_url)( \&self, url: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), request: &[CreateDatasourceRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasourceRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateDatasourceResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasourceResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`CreateDatasourceRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasourceRequest) to a specific worker URL, bypassing HA head-node selection. Used for multi-head access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.