コード例 #1
0
 def _PostCreate(self):
     """Get our connection string and our keys."""
     self.connection_string = util.GetAzureStorageConnectionString(
         self.name, self.resource_group.args)
     self.connection_args = ['--connection-string', self.connection_string]
     self.key = util.GetAzureStorageAccountKey(self.name,
                                               self.resource_group.args)
コード例 #2
0
    def _Create(self):
        """Creates an Azure Files share.

    For Standard Files, see
    https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-create-file-share#create-file-share-through-command-line-interface-cli
    and for Premium Files, see
    https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-create-premium-fileshare#create-a-premium-file-share-using-azure-cli
    """
        logging.info('Creating SMB server %s', self.name)
        if FLAGS.smb_tier == 'Standard_LRS':
            storage_account_number = azure_network.AzureStorageAccount.total_storage_accounts - 1
            self.storage_account_name = 'pkb%s' % FLAGS.run_uri + 'storage' + str(
                storage_account_number)
        elif FLAGS.smb_tier == 'Premium_LRS':
            storage_account_number = (
                azure_network.AzureStorageAccount.total_storage_accounts)
            self.storage_account_name = 'pkb%s' % FLAGS.run_uri + 'filestorage' + str(
                storage_account_number)
            # Premium Files uses a different storage account kind from Standard Files.
            # See links in description for more details.
            self.storage_account = azure_network.AzureStorageAccount(
                storage_type='Premium_LRS',
                region=FLAGS.zone[0] or 'westus2',
                name=self.storage_account_name,
                kind='FileStorage',
                resource_group=self.resource_group,
                use_existing=False)
            self.storage_account.Create()

        self.connection_args = util.GetAzureStorageConnectionArgs(
            self.storage_account_name, self.resource_group.args)
        self.storage_account_key = util.GetAzureStorageAccountKey(
            self.storage_account_name, self.resource_group.args)

        self._AzureSmbCommand('create')
コード例 #3
0
    def _Create(self):
        logging.info('Creating SMB server %s', self.name)
        storage_account_number = azure_network.AzureStorageAccount.total_storage_accounts - 1
        self.storage_account_name = 'pkb%s' % FLAGS.run_uri + 'storage' + str(
            storage_account_number)
        self.connection_args = util.GetAzureStorageConnectionArgs(
            self.storage_account_name, self.resource_group.args)
        self.storage_account_key = util.GetAzureStorageAccountKey(
            self.storage_account_name, self.resource_group.args)

        self._AzureSmbCommand('create')