Add a storage account
        :param StorageCredentials self: this
        :param str name: name of storage account to store
        :param str key: storage key or sas
        :param str endpoint: endpoint
488407
def add_storage_account(self, name, key, endpoint):
        # type: (StorageCredentials, str, str, str) -> None
        
        if name in self._storage_accounts:
            raise ValueError(
                '{} already exists in storage accounts'.format(name))
        self._storage_accounts[name] = StorageAccount(
            name, key, endpoint,
            self._general_options.concurrency.transfer_threads,
            self._general_options.timeout,
            self._general_options.proxy,
        )
987700
public StorageBuilder setUserCredentialsRepository( UserCredentialsRepository userCredentialsRepo, String userId )
    {
        this.userCredentialsRepo = userCredentialsRepo;
        this.userId = userId;

        return this;
    }
477271
def add_path_with_storage_account(self, remote_path, storage_account):
        # type: (SourcePath, str, str) -> None
        
        if len(self._path_map) >= 1:
            raise RuntimeError(
                'cannot add multiple remote paths to SourcePath objects')
        rpath = blobxfer.util.normalize_azure_path(remote_path)
        self.add_path(rpath)
        self._path_map[rpath] = storage_account
1184295
def register_account(self, username, service):
        
        data = {
            'service': service,
            'username': username,
        }

        return self._perform_post_request(self.register_account_endpoint, data, self.token_header)
723731
def pin(self, hostname, x509):
        

        key = self._x509_key(x509)
        self._storage.setdefault(hostname, set()).add(key)
655715
def add_key(self, key, first=False):
        
        if first:
            self.keys = [key] + self.keys
        else:
            self.keys.append(key)
        if isinstance(key, VSpaceKey):
            self.space = key
987965
def try_storage(self, identifier, req, resp, resource, uri_kwargs):
        
        if identifier is None:
            user = None

        # note: if user_storage is defined, always use it in order to
        #       authenticate user.
        elif self.user_storage is not None:
            user = self.user_storage.get_user(
                self, identifier, req, resp, resource, uri_kwargs
            )

        # note: some authentication middleware classes may not require
        #       to be initialized with their own user_storage. In such
        #       case this will always authenticate with "syntetic user"
        #       if there is a valid indentity.
        elif self.user_storage is None and not self.only_with_storage:
            user = {
                'identified_with': self,
                'identifier': identifier
            }

        else:  # pragma: nocover
            # note: this should not happen if the base class is properly
            #       initialized. Still, user can skip super().__init__() call.
            user = None

        return user
605968
function SharedKey(storageAccount, storageAccessKey) {
  this.storageAccount = storageAccount;
  this.storageAccessKey = storageAccessKey;
  this.signer = new HmacSha256Sign(storageAccessKey);
}
209995
def add_username_password(self, use_store=False):
        
        self.argparser.add_argument('--username', default=None, help='Username')
        self.argparser.add_argument('--password', default=None, help='Password')
        self.argparser.add_argument('--clear-store', action='store_true', default=False, help='Clear password keystore')

        self.use_username_password_store = use_store
173444
def get_storage_pool_by_name(self, name):
        
        for storage_pool in self.conn.storage_pools:
            if storage_pool.name == name:
                return storage_pool
        raise KeyError("Storage pool of that name not found")
1088659
def create_new_sub_account(self, account_id, account_name, account_default_group_storage_quota_mb=None, account_default_storage_quota_mb=None, account_default_user_storage_quota_mb=None, account_sis_account_id=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - account_id
        """ID"""
        path["account_id"] = account_id

        # REQUIRED - account[name]
        """The name of the new sub-account."""
        data["account[name]"] = account_name

        # OPTIONAL - account[sis_account_id]
        """The account's identifier in the Student Information System."""
        if account_sis_account_id is not None:
            data["account[sis_account_id]"] = account_sis_account_id

        # OPTIONAL - account[default_storage_quota_mb]
        """The default course storage quota to be used, if not otherwise specified."""
        if account_default_storage_quota_mb is not None:
            data["account[default_storage_quota_mb]"] = account_default_storage_quota_mb

        # OPTIONAL - account[default_user_storage_quota_mb]
        """The default user storage quota to be used, if not otherwise specified."""
        if account_default_user_storage_quota_mb is not None:
            data["account[default_user_storage_quota_mb]"] = account_default_user_storage_quota_mb

        # OPTIONAL - account[default_group_storage_quota_mb]
        """The default group storage quota to be used, if not otherwise specified."""
        if account_default_group_storage_quota_mb is not None:
            data["account[default_group_storage_quota_mb]"] = account_default_group_storage_quota_mb

        self.logger.debug("POST /api/v1/accounts/{account_id}/sub_accounts with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("POST", "/api/v1/accounts/{account_id}/sub_accounts".format(**path), data=data, params=params, single_item=True)
851408
def add_account(self, account, nickname, password):
        
        password = to_binary(password)
        password = hashlib.md5(password).hexdigest()
        return self._post(
            'https://api.weixin.qq.com/customservice/kfaccount/add',
            data={
                'kf_account': account,
                'nickname': nickname,
                'password': password
            }
        )
901288
def get_storage_conn(storage_account=None, storage_key=None, opts=None):
    '''
    
    '''
    if opts is None:
        opts = {}

    if not storage_account:
        storage_account = opts.get('storage_account', None)
    if not storage_key:
        storage_key = opts.get('storage_key', None)

    return azure.storage.BlobService(storage_account, storage_key)
784634
def init_app(self, app):
        
        provider = app.config.get("STORAGE_PROVIDER", None)
        key = app.config.get("STORAGE_KEY", None)
        secret = app.config.get("STORAGE_SECRET", None)
        container = app.config.get("STORAGE_CONTAINER", None)
        allowed_extensions = app.config.get("STORAGE_ALLOWED_EXTENSIONS", None)
        serve_files = app.config.get("STORAGE_SERVER", True)
        serve_files_url = app.config.get("STORAGE_SERVER_URL", "files")

        self.config["serve_files"] = serve_files
        self.config["serve_files_url"] = serve_files_url

        if not provider:
            raise ValueError("'STORAGE_PROVIDER' is missing")

        if provider.upper() == "LOCAL":
            if not os.path.isdir(container):
                raise IOError("Local Container (directory) '%s' is not a "
                              "directory or doesn't exist for LOCAL provider" % container)

        self.__init__(provider=provider,
                      key=key,
                      secret=secret,
                      container=container,
                      allowed_extensions=allowed_extensions)

        self._register_file_server(app)
1309560
def create(name, *ids)
      resource = self.class::RESOURCE_COLLECTION % { account_id: account.id }
      params = to_params.merge!(app_store_identifiers: ids.join(','), name: name)
      response = Request.new(account.client, :post, resource, params: params).perform
      from_response(response.body[:data])
    end
621627
def add_record(self, common_name, serial=0, parent_ca='',
                   signees=None, files=None, record=None,
                   is_ca=False, overwrite=False):
        

        if not overwrite:
            try:
                self.get_record(common_name)
                raise CertExistsError(
                    "Certificate {name} already exists!"
                    " Set overwrite=True to force add."
                    .format(name=common_name))
            except CertNotFoundError:
                pass

        record = record or {
            'serial': serial,
            'is_ca': is_ca,
            'parent_ca': parent_ca,
            'signees': signees,
            'files': files,
        }
        self.store[common_name] = record
        self.save()
1363566
async def AddToUnit(self, storages):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='Storage',
                   request='AddToUnit',
                   version=4,
                   params=_params)
        _params['storages'] = storages
        reply = await self.rpc(msg)
        return reply