Creates a AppendBlobService object with the settings specified in the 
        CloudStorageAccount.

        :return: A service object.
        :rtype: :class:`~azure.storage.blob.appendblobservice.AppendBlobService`
190906
def create_append_blob_service(self):
        '''
        
        '''
        try:
            from azure.storage.blob.appendblobservice import AppendBlobService
            return AppendBlobService(self.account_name, self.account_key,
                                     sas_token=self.sas_token,
                                     is_emulated=self.is_emulated)
        except ImportError:
            raise Exception('The package azure-storage-blob is required. '
                            + 'Please install it using "pip install azure-storage-blob"')
1060030
def _process_synccopy_descriptor(self, sd):
        # type: (SyncCopy, blobxfer.models.synccopy.Descriptor) -> None
        
        # update progress bar
        self._update_progress_bar()
        # get download offsets
        offsets, resume_bytes = sd.next_offsets()
        # add resume bytes to counter
        if resume_bytes is not None:
            with self._transfer_lock:
                self._synccopy_bytes_sofar += resume_bytes
                logger.debug('adding {} sofar {} from {}'.format(
                    resume_bytes, self._synccopy_bytes_sofar,
                    sd.dst_entity.name))
            del resume_bytes
        # check if all operations completed
        if offsets is None and sd.all_operations_completed:
            # finalize upload for non-one shots
            if not sd.is_one_shot_block_blob:
                self._finalize_upload(sd)
            else:
                # set access tier for one shots
                if sd.requires_access_tier_set:
                    blobxfer.operations.azure.blob.block.set_blob_access_tier(
                        sd.dst_entity)
            # accounting
            with self._transfer_lock:
                self._transfer_set.remove(
                    blobxfer.operations.synccopy.SyncCopy.
                    create_unique_transfer_operation_id(
                        sd.src_entity, sd.dst_entity))
                self._synccopy_sofar += 1
            return
        # re-enqueue for finalization if no offsets
        if offsets is None:
            self._transfer_queue.put(sd)
            return
        # prepare upload
        if offsets.chunk_num == 0:
            self._prepare_upload(sd.dst_entity)
        # prepare replica targets
        if blobxfer.util.is_not_empty(sd.dst_entity.replica_targets):
            for ase in sd.dst_entity.replica_targets:
                if offsets.chunk_num == 0:
                    self._prepare_upload(ase)
        # re-enqueue for other threads to download next offset if not append
        if sd.src_entity.mode != blobxfer.models.azure.StorageModes.Append:
            self._transfer_queue.put(sd)
        # issue get range
        if sd.src_entity.mode == blobxfer.models.azure.StorageModes.File:
            data = blobxfer.operations.azure.file.get_file_range(
                sd.src_entity, offsets)
        else:
            data = blobxfer.operations.azure.blob.get_blob_range(
                sd.src_entity, offsets)
        # process data for upload
        self._process_data(sd, sd.dst_entity, offsets, data)
        # iterate replicas
        if blobxfer.util.is_not_empty(sd.dst_entity.replica_targets):
            for ase in sd.dst_entity.replica_targets:
                self._process_data(sd, ase, offsets, data)
        # re-enqueue for append blobs
        if sd.src_entity.mode == blobxfer.models.azure.StorageModes.Append:
            self._transfer_queue.put(sd)
1366789
def __store_service(self, key, service):
        
        self._future_value.setdefault(key, []).append(service)
887276
def create_server(cloud, **kwargs):
    
    if cloud == 'ec2':
        _create_server_ec2(**kwargs)
    elif cloud == 'rackspace':
        _create_server_rackspace(**kwargs)
    elif cloud == 'gce':
        _create_server_gce(**kwargs)
    else:
        raise ValueError("Unknown cloud type: {}".format(cloud))
284797
def create(self, parameters={}, create_keys=True, **kwargs):
        
        # Create the service
        cs = self._create_service(parameters=parameters, **kwargs)

        # Create the service key to get config details and
        # store in local cache file.
        if create_keys:
            cfg = parameters
            cfg.update(self._get_service_config())
            self.settings.save(cfg)
881124
def create(self):
        
        self.service.create()

        # Set environment variables for immediate use
        predix.config.set_env_value(self.use_class, 'uri', self._get_uri())
        predix.config.set_env_value(self.use_class, 'zone_id',
                self._get_zone_id())
1060538
def create_file_service(self):
        '''
        
        '''
        try:
            from azure.storage.file.fileservice import FileService
            return FileService(self.account_name, self.account_key,
                               sas_token=self.sas_token,
                               endpoint_suffix=self.endpoint_suffix)
        except ImportError:
            raise Exception('The package azure-storage-file is required. '
                            + 'Please install it using "pip install azure-storage-file"')
273718
def add_storage(self, storage=None, type='disk', address=None):
        
        self.cloud_manager.attach_storage(server=self.uuid,
                                          storage=storage.uuid,
                                          storage_type=type,
                                          address=address)
        storage.address = address
        storage.type = type
        self.storage_devices.append(storage)
763367
def add_service(self, cls):
        
        service_name = get_service_name(cls)
        container = self.container_cls(cls, self.config)
        self.service_map[service_name] = container
1088479
def create(self, bucket, descriptor, force=False):
        

        # Make lists
        buckets = bucket
        if isinstance(bucket, six.string_types):
            buckets = [bucket]
        descriptors = descriptor
        if isinstance(descriptor, dict):
            descriptors = [descriptor]

        # Iterate over buckets/descriptors
        for bucket, descriptor in zip(buckets, descriptors):

            # Existent bucket
            if bucket in self.buckets:
                if not force:
                    message = 'Bucket "%s" already exists' % bucket
                    raise tableschema.exceptions.StorageError(message)
                self.delete(bucket)

            # Prepare job body
            tableschema.validate(descriptor)
            table_name = self.__mapper.convert_bucket(bucket)
            converted_descriptor, fallbacks = self.__mapper.convert_descriptor(descriptor)
            body = {
                'tableReference': {
                    'projectId': self.__project,
                    'datasetId': self.__dataset,
                    'tableId': table_name,
                },
                'schema': converted_descriptor,
            }

            # Make request
            self.__service.tables().insert(
                projectId=self.__project,
                datasetId=self.__dataset,
                body=body).execute()

            # Add to descriptors/fallbacks
            self.__descriptors[bucket] = descriptor
            self.__fallbacks[bucket] = fallbacks

        # Remove buckets cache
        self.__buckets = None
597120
def create_app():
    
    app = App.create_app(__name__)
    app.configure('.configs.settings')

    # yes, I should use blueprints; but I don't really care for such a small
    # toy app
    @app.route('/config')
    def get_config():
        """Get the current configuration of the app."""
        return jsonify(app.config)

    @app.route('/put_config', methods=['PUT'])
    def put_config():
        """Add to the current configuration of the app.

        Takes any JSON body and adds all keys to the configs with the provided
        values.
        """
        data = request.json()

        for key, val in data.items():
            app.config[key] = val

        return jsonify({'message': 'Config updated!'})

    return app
131589
def create(self, **kwargs):
        
        self.service.create(**kwargs)

        predix.config.set_env_value(self.use_class, 'url',
                self.service.settings.data['url'])
        predix.config.set_env_value(self.use_class, 'access_key_id',
                self.service.settings.data['access_key_id'])
        predix.config.set_env_value(self.use_class, 'bucket_name',
                self.service.settings.data['bucket_name'])
        predix.config.set_env_value(self.use_class, 'host',
                self.service.settings.data['host'])
        predix.config.set_env_value(self.use_class, 'secret_access_key',
                self.service.settings.data['secret_access_key'])
678228
def create(cls, service=Service(), private=False):
        
        response = service.send(SRequest('POST', cls.path, data={'private': private}))
        return cls.from_response(response, service=service)
977811
def create(self, *args, **kwargs):
        
        try:
            return super(CloudBlockStorageManager, self).create(*args,
                    **kwargs)
        except exc.BadRequest as e:
            msg = e.message
            if "Clones currently must be >= original volume size" in msg:
                raise exc.VolumeCloneTooSmall(msg)
            else:
                raise
850906
def create_table_service(self):
        '''
        
        '''
        try:
            from ..table.tableservice import TableService
            return TableService(self.account_name, self.account_key,
                                sas_token=self.sas_token,
                                is_emulated=self.is_emulated)
        except ImportError:
            raise Exception('The package azure-storage-table is required. '
                            + 'Please install it using "pip install azure-storage-table"')
36229
def upload(self, storagemodel:object, modeldefinition = None):
        

        if (storagemodel.content is None) or (storagemodel.properties.content_settings.content_type is None):
            # No content to upload
            raise AzureStorageWrapException(storagemodel, "StorageBlobModel does not contain content nor content settings")

        else:
            blobservice = modeldefinition['blobservice']
            container_name = modeldefinition['container']
            blob_name = storagemodel.name

            try:

                # refresh metadata
                storagemodel.__instance_to_metadata__()

                """ upload bytes """
                blobservice.create_blob_from_bytes(
                        container_name=container_name, 
                        blob_name=blob_name, 
                        blob=storagemodel.content, 
                        metadata=storagemodel.metadata, 
                        content_settings=storagemodel.properties.content_settings
                    )

                storagemodel.properties = blobservice.get_blob_properties(container_name=container_name, blob_name=blob_name).properties
                 
            except Exception as e:
                msg = 'can not save blob in container {} because {!s}'.format(storagemodel._containername, e)
                raise AzureStorageWrapException(storagemodel, msg=msg)
           
        return storagemodel
492081
def create_backup(self, instance, name, description=None):
        
        body = {"backup": {
                "instance": utils.get_id(instance),
                "name": name,
                }}
        if description is not None:
            body["backup"]["description"] = description
        uri = "/backups"
        resp, resp_body = self.api.method_post(uri, body=body)
        mgr = self.api._backup_manager
        return CloudDatabaseBackup(mgr, body.get("backup"))