Beispiel #1
0
    def create_gre_transport_mode(cls, *args, **kwargs):
        """
        Create a transport based route VPN. This VPN type uses IPSEC
        for protecting the payload, therefore a VPN Profile is specified.

        :param str name: name of VPN
        :param TunnelEndpoint local_endpoint: the local side endpoint for
            this VPN.
        :param TunnelEndpoint remote_endpoint: the remote side endpoint for
            this VPN.
        :param str preshared_key: preshared key for RBVPN
        :param TunnelMonitoringGroup monitoring_group: the group to place
            this VPN in for monitoring. (default: 'Uncategorized')
        :param VPNProfile vpn_profile: VPN profile for this VPN.
            (default: VPN-A Suite)
        :param int mtu: Set MTU for this VPN tunnel (default: 0)
        :param boolean pmtu_discovery: enable pmtu discovery (default: True)
        :param int ttl: ttl for connections on the VPN (default: 0)
        :param str comment: optional comment
        :raises CreateVPNFailed: failed to create the VPN with reason
        :rtype: RouteVPN
        """
        versioned_method = get_best_version(
            ("6.5", cls._create_gre_transport_mode_65),
            ("6.6", cls._create_gre_transport_mode_66))
        return versioned_method(*args, **kwargs)
Beispiel #2
0
    def create_ipsec_tunnel(cls, *args, **kwargs):
        """
        The VPN tunnel type negotiates IPsec tunnels in the same way
        as policy-based VPNs, but traffic is selected to be sent into
        the tunnel based on routing.

        :param str name: name of VPN
        :param TunnelEndpoint local_endpoint: the local side endpoint for
            this VPN.
        :param TunnelEndpoint remote_endpoint: the remote side endpoint for
            this VPN.
        :param str preshared_key: required if remote endpoint is an ExternalGateway
        :param TunnelMonitoringGroup monitoring_group: the group to place
            this VPN in for monitoring. Default: 'Uncategorized'.
        :param VPNProfile vpn_profile: VPN profile for this VPN.
            (default: VPN-A Suite)
        :param int mtu: Set MTU for this VPN tunnel (default: 0)
        :param boolean pmtu_discovery: enable pmtu discovery (default: True)
        :param int ttl: ttl for connections on the VPN (default: 0)
        :param bool enabled: enable the RBVPN or leave it disabled
        :param str comment: optional comment
        :raises CreateVPNFailed: failed to create the VPN with reason
        :rtype: RouteVPN
        """
        versioned_method = get_best_version(
            ("6.5", cls._create_ipsec_tunnel_65),
            ("6.6", cls._create_ipsec_tunnel_66))
        return versioned_method(*args, **kwargs)
Beispiel #3
0
    def filesystem(cls, *args, **kwargs):
        """
        A collection of filesystem related statuses

        :rtype: Status
        """
        versioned_method = get_best_version(("6.6", cls._filesystem_6_6),
                                            ("6.7", cls._filesystem_6_7))
        return versioned_method(*args, **kwargs)
Beispiel #4
0
    def sandbox_subsystem(cls, *args, **kwargs):
        """
        A collection of sandbox subsystem statuses

        :rtype: Status
        """
        versioned_method = get_best_version(
            ("6.6", cls._sandbox_subsystem_6_6),
            ("6.7", cls._sandbox_subsystem_6_7))
        return versioned_method(*args, **kwargs)
Beispiel #5
0
    def __get__(self, obj, cls):
        if isinstance(self.attr, tuple):
            if len(self.attr) == 1:
                self.attr = self.attr[0]
            else:
                self.attr = get_best_version(*self.attr)

        if obj is None:
            return self

        return [Element.from_href(href) for href in obj.data.get(self.attr, [])]
Beispiel #6
0
    def create_csr(cls, *args, **kwargs):
        """
        Create a certificate signing request.

        :param str name: name of TLS Server Credential
        :param str rcommon_name: common name for certificate. An example
            would be: "CN=CommonName,O=Organization,OU=Unit,C=FR,ST=PACA,L=Nice".
            At minimum, a "CN" is required.
        :param str public_key_algorithm: public key type to use. Valid values
            rsa, dsa, ecdsa.
        :param str signature_algorithm: signature algorithm. Valid values
            dsa_sha_1, dsa_sha_224, dsa_sha_256, rsa_md5, rsa_sha_1, rsa_sha_256,
            rsa_sha_384, rsa_sha_512, ecdsa_sha_1, ecdsa_sha_256, ecdsa_sha_384,
            ecdsa_sha_512. (Default: rsa_sha_512)
        :param int key_length: length of key. Key length depends on the key
            type. For example, RSA keys can be 1024, 2048, 3072, 4096. See SMC
            documentation for more details.
        :raises CreateElementFailed: failed to create CSR
        :rtype: TLSServerCredential
        """
        versioned_method = get_best_version(("6.6", cls._create_csr_66),
                                            ("6.7", cls._create_csr_67))
        return versioned_method(*args, **kwargs)
Beispiel #7
0
 def _get_action(self, action):
     versioned_method = get_best_version(("6.5", self._get_action_6_5),
                                         ("6.6", self._get_action_6_6))
     return versioned_method(action)
Beispiel #8
0
 def _attr_version(self):
     if isinstance(self.attr, tuple):
         if len(self.attr) == 1:
             self.attr = self.attr[0]
         else:
             self.attr = get_best_version(*self.attr)
Beispiel #9
0
 def __init__(cls, *args, **kwargs):
     versioned_method = get_best_version(("6.6", cls.__init__66),
                                         ("6.7", cls.__init__67))
     versioned_method(*args, **kwargs)