def describe_application_credential_profile_by_id(self, *args, **kwargs): """ Describe Profile By Id [Args] None [Returns] (dict) Response: Describe Profile By Id response (includes any errors) """ banner("PCC.Describe Profile By Id") self._load_kwargs(kwargs) conn = BuiltIn().get_variable_value("${PCC_CONN}") Id= easy.get_metadata_profile_id_by_name(conn,Name=self.Name) return pcc.describe_application_credential_profile_by_id(conn, str(Id))
def add_rados_gateway(self, *args, **kwargs): banner("PCC.Rados Gateway Create") self._load_kwargs(kwargs) print("Kwargs:" + str(kwargs)) try: conn = BuiltIn().get_variable_value("${PCC_CONN}") except Exception as e: raise e if self.cephPoolID == None: self.cephPoolID = easy.get_ceph_pool_id_by_name( conn, self.poolName) if self.certificateID == None: self.certificateID = easy.get_certificate_id_by_name( conn, self.certificateName) if self.port: self.port = ast.literal_eval(str(self.port)) if self.S3Accounts != None or self.S3Accounts != []: tmp_cert = {} for cert in eval(str(self.S3Accounts)): cert_id = easy.get_metadata_profile_id_by_name(conn, cert) tmp_cert[str(cert_id)] = {} self.S3Accounts = tmp_cert tmp_node = [] if self.targetNodes != [] or self.targetNodes != '': for node_name in eval(str(self.targetNodes)): print("Node Name:" + str(node_name)) node_id = easy.get_node_id_by_name(conn, node_name) print("Node Id:" + str(node_id)) tmp_node.append(node_id) print("Node List:" + str(tmp_node)) self.targetNodes = tmp_node if self.service_ip.lower() == "yes": serviceIpType = "NodeIp" else: serviceIpType = "Default" payload = { "name": self.name, "cephPoolID": self.cephPoolID, "targetNodes": self.targetNodes, "port": self.port, "certificateID": self.certificateID, "S3Accounts": self.S3Accounts, "serviceIpType": serviceIpType } print("Payload:-" + str(payload)) return pcc.add_ceph_rgw(conn, payload)
def get_profile_id(self, *args, **kwargs): """ Get Profile Id [Args] (str) Name [Returns] (int) Id: Profile Id if there is one, None: If not found """ self._load_kwargs(kwargs) banner("PCC.Get Profile Id [Name=%s]" % self.Name) conn = BuiltIn().get_variable_value("${PCC_CONN}") return easy.get_metadata_profile_id_by_name(conn, self.Name)
def get_application_credential_profile_by_id(self, *args, **kwargs): """ Get Profile by Id [Args] None [Returns] (dict) Response: Get Profile by Id response (includes any errors) """ banner("PCC.Get Profile by Id") self._load_kwargs(kwargs) conn = BuiltIn().get_variable_value("${PCC_CONN}") Id= easy.get_metadata_profile_id_by_name(conn,Name=self.Name) print("Id response: {}".format(Id)) return pcc.get_application_credential_profile_by_id(conn, str(Id))