def allow_bridging(self, **kwargs): """Allow bridging Example: >>> from libsolace.settingsloader import settings >>> from libsolace.SolaceAPI import SolaceAPI >>> plugin = SolaceAPI("dev", version="soltr/7_1_1").manage("SolaceClientProfile") >>> request = plugin.allow_bridging(name="default", vpn_name="default") >>> request.xml '<rpc semp-version="soltr/7_1_1"><client-profile><name>default</name><vpn-name>default</vpn-name><allow-bridge-connections/></client-profile></rpc>' >>> # api.rpc(request) :param name: name of the profile :param vpn_name: the name of the vpn to scope the request to :type name: str :type vpn_name: str :returns: SEMP request :rtype: plugin.PluginResponse """ name = get_key_from_kwargs("name", kwargs) vpn_name = get_key_from_kwargs("vpn_name", kwargs) self.api.x = SolaceXMLBuilder("Setting Bridging", version=self.api.version) self.api.x.client_profile.name = name if version_equal_or_greater_than('soltr/6_2', self.api.version): self.api.x.client_profile.vpn_name = vpn_name self.api.x.client_profile.allow_bridge_connections self.commands.enqueue(PluginResponse(str(self.api.x), **kwargs)) return PluginResponse(str(self.api.x), **kwargs)
def allow_transacted_sessions(self, **kwargs): """Allow transaction sessions permission Example: >>> from libsolace.settingsloader import settings >>> from libsolace.SolaceAPI import SolaceAPI >>> api = SolaceAPI("dev") >>> request = api.manage("SolaceClientProfile").allow_transacted_sessions(name="default", vpn_name="default") >>> # response = api.rpc(request) :param name: name of the profile :param vpn_name: the name of the vpn to scope the request to :type name: str :type vpn_name: str :returns: SEMP request :rtype: plugin.PluginResponse """ name = get_key_from_kwargs("name", kwargs) vpn_name = get_key_from_kwargs("vpn_name", kwargs) self.api.x = SolaceXMLBuilder("Allow profile transacted sessions", version=self.api.version) self.api.x.client_profile.name = name if version_equal_or_greater_than('soltr/6_2', self.api.version): self.api.x.client_profile.vpn_name = vpn_name self.api.x.client_profile.message_spool.allow_transacted_sessions self.commands.enqueue(PluginResponse(str(self.api.x), **kwargs)) return PluginResponse(str(self.api.x), **kwargs)
def set_max_clients(self, **kwargs): """Set max clients for profile Example: >>> from libsolace.settingsloader import settings >>> from libsolace.SolaceAPI import SolaceAPI >>> api = SolaceAPI("dev") >>> request = api.manage("SolaceClientProfile").set_max_clients(name="default", vpn_name="default", max_clients=500) >>> # response = api.rpc(request) :param name: name of the profile :param vpn_name: the name of the vpn to scope the request to :param max_clients: max number of clients :type name: str :type vpn_name: str :type max_clients: int :returns: SEMP request :rtype: plugin.PluginResponse """ name = get_key_from_kwargs("name", kwargs) vpn_name = get_key_from_kwargs("vpn_name", kwargs) max_clients = get_key_from_kwargs("max_clients", kwargs) self.api.x = SolaceXMLBuilder("Setting Max Clients", version=self.api.version) self.api.x.client_profile.name = name if version_equal_or_greater_than('soltr/6_2', self.api.version): self.api.x.client_profile.vpn_name = vpn_name self.api.x.client_profile.max_connections_per_client_username.value = max_clients self.commands.enqueue(PluginResponse(str(self.api.x), **kwargs)) return PluginResponse(str(self.api.x), **kwargs)
def get(self, **kwargs): """Returns a ClientProfile immediately from both appliances Example: >>> from libsolace.settingsloader import settings >>> from libsolace.SolaceAPI import SolaceAPI >>> api = SolaceAPI("dev") >>> response = api.manage("SolaceClientProfile").get(name="default", vpn_name="default") :param name: name of the profile :param vpn_name: the name of the vpn to scope the request to :param details: get more details boolean :type name: str :type vpn_name: str :type details: bool :rtype: libsolace.SolaceReplyHandler :returns: dictionary representation of client profile """ name = get_key_from_kwargs("name", kwargs) vpn_name = get_key_from_kwargs("vpn_name", kwargs) details = get_key_from_kwargs("details", kwargs, default=False) self.api.x = SolaceXMLBuilder("Get Client Profile", version=self.api.version) self.api.x.show.client_profile.name = name if version_equal_or_greater_than('soltr/6_2', self.api.version): self.api.x.show.client_profile.vpn_name = vpn_name if details: self.api.x.show.client_profile.details # enqueue to validate self.commands.enqueue(PluginResponse(str(self.api.x), **kwargs)) return self.api.rpc(PluginResponse(str(self.api.x), **kwargs))
def delete(self, **kwargs): """Delete a client profile Example: >>> from libsolace.settingsloader import settings >>> from libsolace.SolaceAPI import SolaceAPI >>> api = SolaceAPI("dev") >>> plugin_response = api.manage("SolaceClientProfile").delete(name="default", vpn_name="default") :param name: name of the profile :param vpn_name: the name of the vpn to scope the request to :type name: str :type vpn_name: str :returns: SEMP request :rtype: plugin.PluginResponse """ name = get_key_from_kwargs("name", kwargs) vpn_name = get_key_from_kwargs("vpn_name", kwargs) self.api.x = SolaceXMLBuilder("Delete Client Profile", version=self.api.version) self.api.x.no.client_profile.name = name if version_equal_or_greater_than('soltr/6_2', self.api.version): self.api.x.no.client_profile.vpn_name = vpn_name self.commands.enqueue(PluginResponse(str(self.api.x), **kwargs)) return PluginResponse(str(self.api.x), **kwargs)
def get(self, **kwargs): """Returns a ClientProfile immediately from both appliances Example: >>> import libsolace.settingsloader as settings >>> from libsolace.SolaceAPI import SolaceAPI >>> api = SolaceAPI("dev") >>> response = api.manage("SolaceClientProfile").get(name="default", vpn_name="default") :param name: name of the profile :param vpn_name: the name of the vpn to scope the request to :param details: get more details boolean :type name: str :type vpn_name: str :type details: bool :rtype: libsolace.SolaceReplyHandler :returns: dictionary representation of client profile """ name = get_key_from_kwargs("name", kwargs) vpn_name = get_key_from_kwargs("vpn_name", kwargs) details = get_key_from_kwargs("details", kwargs, default=False) self.api.x = SolaceXMLBuilder("Get Client Profile", version=self.api.version) self.api.x.show.client_profile.name = name if version_equal_or_greater_than("soltr/6_2", self.api.version): self.api.x.show.client_profile.vpn_name = vpn_name if details: self.api.x.show.client_profile.details # enqueue to validate self.commands.enqueue(PluginResponse(str(self.api.x), **kwargs)) return self.api.rpc(PluginResponse(str(self.api.x), **kwargs))
def allow_bridging(self, **kwargs): """Allow bridging Example: >>> import libsolace.settingsloader as settings >>> from libsolace.SolaceAPI import SolaceAPI >>> plugin = SolaceAPI("dev", version="soltr/7_1_1").manage("SolaceClientProfile") >>> request = plugin.allow_bridging(name="default", vpn_name="default") >>> request.xml '<rpc semp-version="soltr/7_1_1"><client-profile><name>default</name><vpn-name>default</vpn-name><allow-bridge-connections/></client-profile></rpc>' >>> # api.rpc(request) :param name: name of the profile :param vpn_name: the name of the vpn to scope the request to :type name: str :type vpn_name: str :returns: SEMP request :rtype: plugin.PluginResponse """ name = get_key_from_kwargs("name", kwargs) vpn_name = get_key_from_kwargs("vpn_name", kwargs) self.api.x = SolaceXMLBuilder("Setting Bridging", version=self.api.version) self.api.x.client_profile.name = name if version_equal_or_greater_than("soltr/6_2", self.api.version): self.api.x.client_profile.vpn_name = vpn_name self.api.x.client_profile.allow_bridge_connections self.commands.enqueue(PluginResponse(str(self.api.x), **kwargs)) return PluginResponse(str(self.api.x), **kwargs)
def set_max_clients(self, **kwargs): """Set max clients for profile Example: >>> import libsolace.settingsloader as settings >>> from libsolace.SolaceAPI import SolaceAPI >>> api = SolaceAPI("dev") >>> request = api.manage("SolaceClientProfile").set_max_clients(name="default", vpn_name="default", max_clients=500) >>> # response = api.rpc(request) :param name: name of the profile :param vpn_name: the name of the vpn to scope the request to :param max_clients: max number of clients :type name: str :type vpn_name: str :type max_clients: int :returns: SEMP request :rtype: plugin.PluginResponse """ name = get_key_from_kwargs("name", kwargs) vpn_name = get_key_from_kwargs("vpn_name", kwargs) max_clients = get_key_from_kwargs("max_clients", kwargs) self.api.x = SolaceXMLBuilder("Setting Max Clients", version=self.api.version) self.api.x.client_profile.name = name if version_equal_or_greater_than("soltr/6_2", self.api.version): self.api.x.client_profile.vpn_name = vpn_name self.api.x.client_profile.max_connections_per_client_username.value = max_clients self.commands.enqueue(PluginResponse(str(self.api.x), **kwargs)) return PluginResponse(str(self.api.x), **kwargs)
def allow_transacted_sessions(self, **kwargs): """Allow transaction sessions permission Example: >>> import libsolace.settingsloader as settings >>> from libsolace.SolaceAPI import SolaceAPI >>> api = SolaceAPI("dev") >>> request = api.manage("SolaceClientProfile").allow_transacted_sessions(name="default", vpn_name="default") >>> # response = api.rpc(request) :param name: name of the profile :param vpn_name: the name of the vpn to scope the request to :type name: str :type vpn_name: str :returns: SEMP request :rtype: plugin.PluginResponse """ name = get_key_from_kwargs("name", kwargs) vpn_name = get_key_from_kwargs("vpn_name", kwargs) self.api.x = SolaceXMLBuilder("Allow profile transacted sessions", version=self.api.version) self.api.x.client_profile.name = name if version_equal_or_greater_than("soltr/6_2", self.api.version): self.api.x.client_profile.vpn_name = vpn_name self.api.x.client_profile.message_spool.allow_transacted_sessions self.commands.enqueue(PluginResponse(str(self.api.x), **kwargs)) return PluginResponse(str(self.api.x), **kwargs)
def delete(self, **kwargs): """Delete a client profile Example: >>> import libsolace.settingsloader as settings >>> from libsolace.SolaceAPI import SolaceAPI >>> api = SolaceAPI("dev") >>> plugin_response = api.manage("SolaceClientProfile").delete(name="default", vpn_name="default") :param name: name of the profile :param vpn_name: the name of the vpn to scope the request to :type name: str :type vpn_name: str :returns: SEMP request :rtype: plugin.PluginResponse """ name = get_key_from_kwargs("name", kwargs) vpn_name = get_key_from_kwargs("vpn_name", kwargs) self.api.x = SolaceXMLBuilder("Delete Client Profile", version=self.api.version) self.api.x.no.client_profile.name = name if version_equal_or_greater_than("soltr/6_2", self.api.version): self.api.x.no.client_profile.vpn_name = vpn_name self.commands.enqueue(PluginResponse(str(self.api.x), **kwargs)) return PluginResponse(str(self.api.x), **kwargs)