-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rd 626 support create if missing (#190)
* add create if missing for webapp and plan * use resource factory to check if resource exist * use function in order to save common info in runtime props * remove logs * use function to save external resource details * fix plan tests and add external resouce and create if missing tests * add genereate cloud error function, add tests for webapp with create if missing and refactor tests structure * fix plan delete * use function to get azure config and create loadbalancer backend puul resource in sdk * implement get load balancer backend pool in sdk * add create if missing for load balancer backend pool * remove uneccesary inputs from example blueprint * flake8 * add loadbalancer probe sdk * fix load balancer probe bug and add create if missing to lb probes * remove comments * fix lb rule bug * add create if missing for loadbalancer rule * add create if missing for inbound nat rule * flake8 fixes * Rd 626 support create if missing neteork resources (#191) * some refactoring for the network resources * fix subnet params bug * Rd 626 support create if missing storage resources (#192) * add file share sdk and task * clean storage account * more refactoring for storage account * change mapping * add delete operation for fileshare * add storage account runtime property * Rd 626 support create if missing compute resources (#193) * add create if missing for managed cluster * add operation for aks * map aks store kubeconfig operation * delete comments * delete one more comment * bump version
- Loading branch information
1 parent
26b7794
commit b7dc1ce
Showing
31 changed files
with
926 additions
and
832 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
from azure.mgmt.storage import StorageManagementClient | ||
|
||
from cloudify_azure import (constants, utils) | ||
from azure_sdk.common import AzureResource | ||
|
||
|
||
class FileShare(AzureResource): | ||
|
||
def __init__(self, azure_config, logger, | ||
api_version=constants.API_VER_STORAGE_FILE_SHARE): | ||
super(FileShare, self).__init__(azure_config) | ||
self.logger = logger | ||
self.client = \ | ||
StorageManagementClient(self.credentials, self.subscription_id, | ||
api_version=api_version) | ||
|
||
def get(self, group_name, account_name, share_name): | ||
self.logger.info("Get File Share...{0}".format(share_name)) | ||
file_share = self.client.file_shares.get( | ||
resource_group_name=group_name, | ||
account_name=account_name, | ||
share_name=share_name | ||
).as_dict() | ||
self.logger.info( | ||
'Get File Share result: {0}'.format( | ||
utils.secure_logging_content(file_share))) | ||
return file_share | ||
|
||
def create(self, | ||
group_name, | ||
account_name, | ||
share_name, | ||
metadata=None, | ||
share_quota=None): | ||
self.logger.info( | ||
"Create File Share...{0}".format(share_name)) | ||
file_share = self.client.file_shares.create( | ||
resource_group_name=group_name, | ||
account_name=account_name, | ||
share_name=share_name, | ||
metadata=metadata, | ||
share_quota=share_quota, | ||
).as_dict() | ||
self.logger.info( | ||
'Create File Share result : {0}'.format( | ||
utils.secure_logging_content(file_share))) | ||
return file_share | ||
|
||
def delete(self, group_name, account_name, share_name): | ||
self.logger.info("Deleting File Share...{0}".format(share_name)) | ||
self.client.file_shares.delete( | ||
resource_group_name=group_name, | ||
account_name=account_name, | ||
share_name=share_name | ||
) | ||
self.logger.debug( | ||
'Deleted File Share {0}'.format(share_name)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.