To communicate with the DeepAffex™ Cloud services requires a CloudConfig when constructing the CloudAPI instance.

There are a couple helpers for managing the CloudConfig but it is just a structure of properties, some of which are optional or only used in certain contexts so can be populated manually and these facilities are provided to ease adoption.


The password and license fields should be managed in a secure fashion and while these examples show a convenient way to manage for development, a production usage would provide better security around the credentials.

The YAML format of the dfxcloud.yaml file is designed so it can be used in both simple single server configuration scenarios and more complex scenarios involving multiple servers and credentials.

# Sample simple ~/.dfxcloud.yaml also available with: dfxcli config sample       # Provided during sign-up
auth-password=ODsuB0vsHFM70zi      # Provided during sign-up
auth-org=somewhere                 # Provided during sign-up
license=k1qURX13BH66LAk            # Provided during sign-up

This YAML file can be loaded with the following code:

CloudConfig config;
auto result = dfx::api::loadCloudConfig(config, "~/.dfxcloud.yaml")
if ( result != CloudStatus::OK ) {
      // Failure for some reason

Alternatively, this could be manually constructed in source:

CloudConfig config;

In more advanced scenarios, the dfxcloud.yaml may contain multiple server and user credential configurations which are identified by the context key. It achieves this by processing the file content in multiple passes. For instance, a configuration file can manage separate REST or WebSocket contexts which are specified prior to loading. This is how the dfxcli tool handles the -c context option to switch targets.

# Show example of advanced multi-context YAML format
dfxcli config sample -a
CloudConfig config;
config.context = "joe-rest";    // Identify a context key to load
auto result = dfx::api::loadCloudConfig(config, "~/.dfxcloud.yaml")
if ( result != CloudStatus::OK ) {
      // Failure for some reason