{
  "swagger": "2.0",
  "schemes": [
    "https"
  ],
  "host": "azure.local",
  "info": {
    "title": "Azure Machine Learning Datastore Management Client",
    "version": "2019-08-01",
    "x-apisguru-categories": [
      "cloud"
    ],
    "x-logo": {
      "url": "https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png"
    },
    "x-origin": [
      {
        "format": "swagger",
        "url": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/machinelearningservices/data-plane/Microsoft.MachineLearningServices/preview/2019-08-01/datastore.json",
        "version": "2.0"
      }
    ],
    "x-preferred": false,
    "x-providerName": "azure.com",
    "x-serviceName": "machinelearningservices-datastore",
    "x-tags": [
      "Azure",
      "Microsoft"
    ]
  },
  "produces": [
    "application/json"
  ],
  "securityDefinitions": {
    "azure_auth": {
      "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
      "flow": "implicit",
      "scopes": {
        "user_impersonation": "impersonate your user account"
      },
      "type": "oauth2"
    }
  },
  "security": [
    {
      "azure_auth": [
        "user_impersonation"
      ]
    }
  ],
  "parameters": {
    "resourceGroupNameParameter": {
      "description": "The Name of the resource group in which the workspace is located.",
      "in": "path",
      "name": "resourceGroupName",
      "required": true,
      "type": "string",
      "x-ms-parameter-location": "method"
    },
    "subscriptionIdParameter": {
      "description": "The Azure Subscription ID.",
      "format": "uuid",
      "in": "path",
      "name": "subscriptionId",
      "required": true,
      "type": "string",
      "x-ms-parameter-location": "method"
    },
    "workspaceNameParameter": {
      "description": "The name of the workspace.",
      "in": "path",
      "name": "workspaceName",
      "required": true,
      "type": "string",
      "x-ms-parameter-location": "method"
    }
  },
  "tags": [],
  "paths": {
    "/datastore/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores": {
      "delete": {
        "consumes": [],
        "description": "Delete all Datastores in the workspace.",
        "operationId": "DeleteAll",
        "parameters": [
          {
            "$ref": "#/parameters/subscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/resourceGroupNameParameter"
          },
          {
            "$ref": "#/parameters/workspaceNameParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "All the Datastores in the workspace are deleted successfully."
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "summary": "Delete all Datastores.",
        "tags": [
          "DataStore"
        ]
      },
      "get": {
        "consumes": [],
        "description": "Get the list of Datastores attached to the workspace.",
        "operationId": "List",
        "parameters": [
          {
            "$ref": "#/parameters/subscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/resourceGroupNameParameter"
          },
          {
            "$ref": "#/parameters/workspaceNameParameter"
          },
          {
            "collectionFormat": "multi",
            "description": "List of Datastore names.",
            "in": "query",
            "items": {
              "type": "string"
            },
            "name": "dataStoreNames",
            "required": false,
            "type": "array",
            "uniqueItems": false
          },
          {
            "description": "The Continuation Token.",
            "in": "query",
            "name": "continuationToken",
            "required": false,
            "type": "string"
          },
          {
            "default": 30,
            "description": "Count of Datastores to be returned.",
            "format": "int32",
            "in": "query",
            "name": "count",
            "required": false,
            "type": "integer"
          },
          {
            "default": true,
            "description": "Whether to include the datastore secret in the response.",
            "in": "query",
            "name": "includeSecret",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "The list of Datastores are returned successfully.",
            "schema": {
              "$ref": "#/definitions/PaginatedDataStoreList"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "summary": "Get Datastores list.",
        "tags": [
          "DataStore"
        ],
        "x-ms-pageable": {
          "nextLinkName": "nextLink"
        }
      },
      "post": {
        "consumes": [
          "application/json"
        ],
        "description": "Create or update a Datastore in the given workspace.",
        "operationId": "Create",
        "parameters": [
          {
            "$ref": "#/parameters/subscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/resourceGroupNameParameter"
          },
          {
            "$ref": "#/parameters/workspaceNameParameter"
          },
          {
            "description": "The Datastore details.",
            "in": "body",
            "name": "dto",
            "required": false,
            "schema": {
              "$ref": "#/definitions/DataStore"
            }
          },
          {
            "default": false,
            "description": "If set to true, the call will create an Datastore if it doesn't exist.",
            "in": "query",
            "name": "createIfNotExists",
            "required": false,
            "type": "boolean"
          },
          {
            "default": false,
            "description": "If set to true, the call will skip Datastore validation.",
            "in": "query",
            "name": "skipValidation",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "The Datastore is created/updated successfully."
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "summary": "Create or update a Datastore.",
        "tags": [
          "DataStore"
        ]
      }
    },
    "/datastore/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}": {
      "delete": {
        "consumes": [],
        "description": "Delete a Datastore with a specific name.",
        "operationId": "Delete",
        "parameters": [
          {
            "$ref": "#/parameters/subscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/resourceGroupNameParameter"
          },
          {
            "$ref": "#/parameters/workspaceNameParameter"
          },
          {
            "description": "The Datastore name.",
            "in": "path",
            "name": "name",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "The Datastore is deleted successfully."
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "summary": "Delete a Datastore.",
        "tags": [
          "DataStore"
        ]
      },
      "get": {
        "consumes": [],
        "description": "Get details of a Datastore with a specific name.",
        "operationId": "Get",
        "parameters": [
          {
            "$ref": "#/parameters/subscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/resourceGroupNameParameter"
          },
          {
            "$ref": "#/parameters/workspaceNameParameter"
          },
          {
            "description": "The Datastore name.",
            "in": "path",
            "name": "name",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "The Datastore details are returned successfully.",
            "schema": {
              "$ref": "#/definitions/DataStore"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "summary": "Get Datastore details.",
        "tags": [
          "DataStore"
        ]
      },
      "put": {
        "consumes": [
          "application/json"
        ],
        "description": "Update or create a Datastore in the given workspace.",
        "operationId": "Update",
        "parameters": [
          {
            "$ref": "#/parameters/subscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/resourceGroupNameParameter"
          },
          {
            "$ref": "#/parameters/workspaceNameParameter"
          },
          {
            "description": "The Datastore name.",
            "in": "path",
            "name": "name",
            "required": true,
            "type": "string"
          },
          {
            "description": "The Datastore details.",
            "in": "body",
            "name": "dto",
            "required": false,
            "schema": {
              "$ref": "#/definitions/DataStore"
            }
          },
          {
            "default": false,
            "description": "If set to true, the call will create an Datastore if it doesn't exist.",
            "in": "query",
            "name": "createIfNotExists",
            "required": false,
            "type": "boolean"
          },
          {
            "default": false,
            "description": "If set to true, the call will skip Datastore validation.",
            "in": "query",
            "name": "skipValidation",
            "required": false,
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "The Datastore is created/updated successfully."
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "summary": "Update or create a Datastore.",
        "tags": [
          "DataStore"
        ]
      }
    },
    "/datastore/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/default": {
      "get": {
        "consumes": [],
        "description": "Get the default Datastore in the workspace.",
        "operationId": "GetDefault",
        "parameters": [
          {
            "$ref": "#/parameters/subscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/resourceGroupNameParameter"
          },
          {
            "$ref": "#/parameters/workspaceNameParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "The default Datastore is returned successfully.",
            "schema": {
              "$ref": "#/definitions/DataStore"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "summary": "Get the default Datastore.",
        "tags": [
          "DataStoreDefault"
        ]
      }
    },
    "/datastore/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/default/{name}": {
      "put": {
        "consumes": [],
        "description": "Set a default Datastore in the workspace.",
        "operationId": "SetDefault",
        "parameters": [
          {
            "$ref": "#/parameters/subscriptionIdParameter"
          },
          {
            "$ref": "#/parameters/resourceGroupNameParameter"
          },
          {
            "$ref": "#/parameters/workspaceNameParameter"
          },
          {
            "description": "The Datastore name.",
            "in": "path",
            "name": "name",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "The default Datastore is set successfully."
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "summary": "Set a default Datastore.",
        "tags": [
          "DataStoreDefault"
        ]
      }
    }
  },
  "definitions": {
    "AzureDataLake": {
      "properties": {
        "authorityUrl": {
          "description": "The authority URL used for authentication",
          "type": "string"
        },
        "certificate": {
          "description": "The content of the certificate used for authentication",
          "type": "string"
        },
        "clientId": {
          "description": "The Client ID/Application ID",
          "format": "uuid",
          "type": "string"
        },
        "clientSecret": {
          "description": "The client secret",
          "type": "string"
        },
        "isCertAuth": {
          "description": "Is it using certificate to authenticate. If false then use client secret",
          "type": "boolean"
        },
        "resourceGroup": {
          "description": "Resource Group Name",
          "type": "string"
        },
        "resourceUri": {
          "description": "The resource the service principal/app has access to",
          "type": "string"
        },
        "storeName": {
          "description": "The Azure Data Lake store name",
          "type": "string"
        },
        "subscriptionId": {
          "description": "Subscription Id",
          "format": "uuid",
          "type": "string"
        },
        "tenantId": {
          "description": "The ID of the tenant the service principal/app belongs to",
          "format": "uuid",
          "type": "string"
        },
        "thumbprint": {
          "description": "The thumbprint of the certificate above",
          "type": "string"
        }
      },
      "type": "object"
    },
    "AzurePostgreSql": {
      "properties": {
        "databaseName": {
          "description": "The Azure PostgreSQL database name",
          "type": "string"
        },
        "endpoint": {
          "description": "The Azure PostgreSQL server host endpoint",
          "type": "string"
        },
        "portNumber": {
          "description": "The Azure PostgreSQL port number",
          "type": "string"
        },
        "resourceGroup": {
          "description": "Resource Group Name",
          "type": "string"
        },
        "serverName": {
          "description": "The Azure PostgreSQL server name",
          "type": "string"
        },
        "subscriptionId": {
          "description": "Subscription Id",
          "format": "uuid",
          "type": "string"
        },
        "userId": {
          "description": "The Azure PostgreSQL user id",
          "type": "string"
        },
        "userPassword": {
          "description": "The Azure PostgreSQL user password",
          "type": "string"
        }
      },
      "type": "object"
    },
    "AzureSqlDatabase": {
      "properties": {
        "authorityUrl": {
          "description": "The authority URL used for authentication",
          "type": "string"
        },
        "certificate": {
          "description": "The content of the certificate used for authentication",
          "type": "string"
        },
        "clientId": {
          "description": "The Client ID/Application ID",
          "format": "uuid",
          "type": "string"
        },
        "clientSecret": {
          "description": "The client secret",
          "type": "string"
        },
        "databaseName": {
          "description": "The Azure SQL database name",
          "type": "string"
        },
        "endpoint": {
          "description": "The server host endpoint",
          "type": "string"
        },
        "isCertAuth": {
          "description": "Is it using certificate to authenticate. If false then use client secret",
          "type": "boolean"
        },
        "resourceGroup": {
          "description": "Resource Group Name",
          "type": "string"
        },
        "resourceUri": {
          "description": "The resource the service principal/app has access to",
          "type": "string"
        },
        "serverName": {
          "description": "The Azure SQL server name",
          "type": "string"
        },
        "subscriptionId": {
          "description": "Subscription Id",
          "format": "uuid",
          "type": "string"
        },
        "tenantId": {
          "description": "The ID of the tenant the service principal/app belongs to",
          "format": "uuid",
          "type": "string"
        },
        "thumbprint": {
          "description": "The thumbprint of the certificate above",
          "type": "string"
        }
      },
      "type": "object"
    },
    "AzureStorage": {
      "properties": {
        "accountKey": {
          "description": "Storage Account Key (Deprecated)",
          "type": "string"
        },
        "accountName": {
          "description": "Storage Account Name",
          "type": "string"
        },
        "areWorkspaceManagedIdentitiesAllowed": {
          "description": "Indicate if we are using Workspace ManagedIdentities/MSI token",
          "type": "boolean"
        },
        "blobCacheTimeout": {
          "description": "If this is an Microsoft.MachineLearning.DataStore.Contracts.DataStoreType.AzureBlob, the length of time (in seconds) to cache files locally after they are accessed (downloaded).",
          "format": "int32",
          "type": "integer"
        },
        "clientCredentials": {
          "$ref": "#/definitions/ClientCredentials",
          "description": "Service principal credential when credential type is Microsoft.MachineLearning.DataStore.Contracts.AzureStorageCredentialTypes.ClientCredentials"
        },
        "containerName": {
          "description": "The storage container name",
          "type": "string"
        },
        "credential": {
          "description": "The credential",
          "type": "string"
        },
        "credentialType": {
          "description": "The credential type",
          "enum": [
            "None",
            "Sas",
            "AccountKey",
            "ClientCredentials"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": false,
            "name": "AzureStorageCredentialTypes"
          }
        },
        "endpoint": {
          "description": "The host of the container",
          "type": "string"
        },
        "isSas": {
          "description": "Indicate if we are using SAS token or Account Key (Deprecated)",
          "type": "boolean"
        },
        "protocol": {
          "description": "The protocol to use. Defaults to https",
          "type": "string"
        },
        "resourceGroup": {
          "description": "Resource Group Name",
          "type": "string"
        },
        "sasToken": {
          "description": "SAS Token for the container (Deprecated)",
          "type": "string"
        },
        "subscriptionId": {
          "description": "Subscription Id",
          "format": "uuid",
          "type": "string"
        }
      },
      "type": "object"
    },
    "ClientCredentials": {
      "properties": {
        "authorityUrl": {
          "description": "The authority URL used for authentication",
          "type": "string"
        },
        "certificate": {
          "description": "The content of the certificate used for authentication",
          "type": "string"
        },
        "clientId": {
          "description": "The Client ID/Application ID",
          "format": "uuid",
          "type": "string"
        },
        "clientSecret": {
          "description": "The client secret",
          "type": "string"
        },
        "isCertAuth": {
          "description": "Is it using certificate to authenticate. If false then use client secret",
          "type": "boolean"
        },
        "resourceGroup": {
          "description": "Resource Group Name",
          "type": "string"
        },
        "resourceUri": {
          "description": "The resource the service principal/app has access to",
          "type": "string"
        },
        "subscriptionId": {
          "description": "Subscription Id",
          "format": "uuid",
          "type": "string"
        },
        "tenantId": {
          "description": "The ID of the tenant the service principal/app belongs to",
          "format": "uuid",
          "type": "string"
        },
        "thumbprint": {
          "description": "The thumbprint of the certificate above",
          "type": "string"
        }
      },
      "type": "object"
    },
    "DataStore": {
      "properties": {
        "azureDataLakeSection": {
          "$ref": "#/definitions/AzureDataLake",
          "description": "Data Specific to azure data lake"
        },
        "azurePostgreSqlSection": {
          "$ref": "#/definitions/AzurePostgreSql",
          "description": "Data specific to azure PostgreSQL"
        },
        "azureSqlDatabaseSection": {
          "$ref": "#/definitions/AzureSqlDatabase",
          "description": "Data specific to azure SQL database"
        },
        "azureStorageSection": {
          "$ref": "#/definitions/AzureStorage",
          "description": "Data specific to azure storage"
        },
        "dataStoreType": {
          "description": "The Azure storage service this datastore points to.",
          "enum": [
            "AzureBlob",
            "AzureFile",
            "AzureDataLake",
            "AzureSqlDatabase",
            "AzurePostgreSql",
            "DBFS",
            "AzureDataLakeGen2",
            "GlusterFs"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": false,
            "name": "DataStoreType"
          }
        },
        "glusterFsSection": {
          "$ref": "#/definitions/GlusterFs",
          "description": "Data specific to GlusterFS"
        },
        "hasBeenValidated": {
          "description": "A read only property that denotes whether the service datastore has been validated with credentials.",
          "type": "boolean"
        },
        "name": {
          "description": "Name of the datastore",
          "type": "string"
        },
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Tags to datastore",
          "type": "object"
        }
      },
      "type": "object"
    },
    "ErrorDetails": {
      "description": "The error details.",
      "properties": {
        "code": {
          "description": "The error code.",
          "type": "string"
        },
        "message": {
          "description": "The error message.",
          "type": "string"
        },
        "target": {
          "description": "The target of the error (e.g., the name of the property in error).",
          "type": "string"
        }
      },
      "type": "object"
    },
    "ErrorResponse": {
      "description": "The error response.",
      "properties": {
        "correlation": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Dictionary containing correlation details for the error.",
          "type": "object"
        },
        "environment": {
          "description": "The hosting environment.",
          "type": "string"
        },
        "error": {
          "$ref": "#/definitions/RootError",
          "description": "The top level error that occurred."
        },
        "location": {
          "description": "The Azure region.",
          "type": "string"
        },
        "time": {
          "description": "The time in UTC.",
          "format": "date-time",
          "type": "string"
        }
      },
      "type": "object"
    },
    "GlusterFs": {
      "properties": {
        "serverAddress": {
          "description": "The server address of one of the servers that hosts the GlusterFS. Can be either the IP address\r\nor server name.",
          "type": "string"
        },
        "volumeName": {
          "description": "The name of the created GlusterFS volume.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "InnerErrorResponse": {
      "description": "A nested structure of errors.",
      "properties": {
        "code": {
          "description": "The error code.",
          "type": "string"
        },
        "innerError": {
          "$ref": "#/definitions/InnerErrorResponse",
          "description": "A nested list of inner errors. When evaluating errors, clients MUST traverse through all of the nested “innerErrors” and choose the deepest one that they understand."
        }
      },
      "type": "object"
    },
    "PaginatedDataStoreList": {
      "description": "A paginated list of DataStores.",
      "properties": {
        "continuationToken": {
          "description": "The token used in retrieving the next page.  If null, there are no additional pages.",
          "type": "string"
        },
        "nextLink": {
          "description": "The link to the next page constructed using the continuationToken.  If null, there are no additional pages.",
          "type": "string"
        },
        "value": {
          "description": "An array of objects of type DataStore.",
          "items": {
            "$ref": "#/definitions/DataStore"
          },
          "type": "array",
          "uniqueItems": false
        }
      },
      "type": "object"
    },
    "RootError": {
      "description": "The root error.",
      "properties": {
        "code": {
          "description": "The service-defined error code. Supported error codes: ServiceError, UserError, ValidationError, AzureStorageError, TransientError, RequestThrottled.",
          "type": "string"
        },
        "details": {
          "description": "The related errors that occurred during the request.",
          "items": {
            "$ref": "#/definitions/ErrorDetails"
          },
          "type": "array",
          "uniqueItems": false
        },
        "innerError": {
          "$ref": "#/definitions/InnerErrorResponse",
          "description": "A nested list of inner errors. When evaluating errors, clients MUST traverse through all of the nested “innerErrors” and choose the deepest one that they understand."
        },
        "message": {
          "description": "A human-readable representation of the error.",
          "type": "string"
        },
        "target": {
          "description": "The target of the error (e.g., the name of the property in error).",
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}