CosmosDBOutput Interface

public interface CosmosDBOutput

CosmosDBOutput(name = "database", databaseName = "ToDoList", collectionName = "Items", connectionStringSetting = "AzureCosmosDBConnection") ) { return "{ \"id": "" + System.currentTimeMillis() + "", "description": "" + message + "" }"; }

Method Summary

Modifier and Type Method and Description
String collectionName()

Defines the collection name of the CosmosDB to which to write.

int collectionThroughput()

If CreateIfNotExists is true, defines the throughput of the created collection.

String connectionStringSetting()

Defines the app setting name that contains the CosmosDB connection string.

boolean createIfNotExists()

Defines the ID of the CosmosDB to which to write.

String databaseName()

Defines the database name of the CosmosDB to which to write.

String dataType()

Defines how Functions runtime should treat the parameter value. Possible values are:

    <li>
    
      <p>"" or string: treat it as a string whose value is serialized from the parameter </p>
    
    </li>
    
    <li>
    
      <p>binary: treat it as a binary data whose value comes from for example OutputBinding&lt;byte[]&gt; </p>
    
    </li>
    

String name()

The variable name used in function.json.

String partitionKey()

Defines the partition key path for the created collection when createIfNotExists is set to true. May include binding parameters.

String preferredLocations()

Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. Values should be comma-separated. example, PreferredLocations = "East US,South Central US,North Europe"

boolean useMultipleWriteLocations()

Enable to use with Multi Master accounts.

Method Details

collectionName

public String collectionName()

Defines the collection name of the CosmosDB to which to write.

Returns:

The collection name string.

collectionThroughput

public int collectionThroughput() default -1

If CreateIfNotExists is true, defines the throughput of the created collection.

Returns:

Throughput of the created collection.

connectionStringSetting

public String connectionStringSetting()

Defines the app setting name that contains the CosmosDB connection string.

Returns:

The app setting name of the connection string.

createIfNotExists

public boolean createIfNotExists() default false

Defines the ID of the CosmosDB to which to write.

Returns:

The ID string.

databaseName

public String databaseName()

Defines the database name of the CosmosDB to which to write.

Returns:

The database name string.

dataType

public String dataType() default ""

Defines how Functions runtime should treat the parameter value. Possible values are:

    <li>
    
      <p>"" or string: treat it as a string whose value is serialized from the parameter </p>
    
    </li>
    
    <li>
    
      <p>binary: treat it as a binary data whose value comes from for example OutputBinding&lt;byte[]&gt; </p>
    
    </li>
    

Returns:

The dataType which will be used by the Functions runtime.

name

public String name()

The variable name used in function.json.

Returns:

The variable name used in function.json.

partitionKey

public String partitionKey() default ""

Defines the partition key path for the created collection when createIfNotExists is set to true. May include binding parameters.

Returns:

partitionKey of the created collection.

preferredLocations

public String preferredLocations() default ""

Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. Values should be comma-separated. example, PreferredLocations = "East US,South Central US,North Europe"

Returns:

PreferredLocations for geo-replicated database accounts

useMultipleWriteLocations

public boolean useMultipleWriteLocations() default false

Enable to use with Multi Master accounts.

Returns:

whether to Multi Master accounts

Applies to