def new_instance(cls,
                     crn: str,
                     zone_identifier: str,
                     service_name: str = DEFAULT_SERVICE_NAME,
                    ) -> 'GlobalLoadBalancerV1':
        """
        Return a new client for the Global Load Balancer service using the
               specified parameters and external configuration.

        :param str crn: Full CRN of the service instance.

        :param str zone_identifier: zone identifier.
        """
        if crn is None:
            raise ValueError('crn must be provided')
        if zone_identifier is None:
            raise ValueError('zone_identifier must be provided')

        authenticator = get_authenticator_from_environment(service_name)
        service = cls(
            crn,
            zone_identifier,
            authenticator
            )
        service.configure_service(service_name)
        return service
    def new_instance(
        cls,
        crn: str,
        zone_identifier: str,
        service_name: str = DEFAULT_SERVICE_NAME,
    ) -> 'UserAgentBlockingRulesV1':
        """
        Return a new client for the User-Agent Blocking Rules service using the
               specified parameters and external configuration.

        :param str crn: Full url-encoded cloud resource name (CRN) of resource
               instance.

        :param str zone_identifier: Zone identifier of the zone for which
               user-agent rule is created.
        """
        if crn is None:
            raise ValueError('crn must be provided')
        if zone_identifier is None:
            raise ValueError('zone_identifier must be provided')

        authenticator = get_authenticator_from_environment(service_name)
        service = cls(crn, zone_identifier, authenticator)
        service.configure_service(service_name)
        return service
    def new_instance(cls,
                     crn: str,
                     zone_identifier: str,
                     service_name: str = DEFAULT_SERVICE_NAME,
                    ) -> 'SslCertificateApiV1':
        """
        Return a new client for the SSL Certificate API service using the specified
               parameters and external configuration.

        :param str crn: cloud resource name.

        :param str zone_identifier: zone identifier.
        """
        if crn is None:
            raise ValueError('crn must be provided')
        if zone_identifier is None:
            raise ValueError('zone_identifier must be provided')

        authenticator = get_authenticator_from_environment(service_name)
        service = cls(
            crn,
            zone_identifier,
            authenticator
            )
        service.configure_service(service_name)
        return service
 def new_instance(
     cls,
     service_name: str = DEFAULT_SERVICE_NAME,
 ) -> 'EnterpriseUsageReportsV1':
     """
     Return a new client for the Enterprise Usage Reports service using the
            specified parameters and external configuration.
     """
     authenticator = get_authenticator_from_environment(service_name)
     service = cls(authenticator)
     service.configure_service(service_name)
     return service
 def new_instance(
     cls,
     service_name: str = DEFAULT_SERVICE_NAME,
 ) -> 'PermittedNetworksForDnsZonesV1':
     """
     Return a new client for the Permitted Networks for DNS Zones service using
            the specified parameters and external configuration.
     """
     authenticator = get_authenticator_from_environment(service_name)
     service = cls(authenticator)
     service.configure_service(service_name)
     return service
 def new_instance(
     cls,
     service_name: str = DEFAULT_SERVICE_NAME,
 ) -> 'IbmCloudCodeEngineV1':
     """
     Return a new client for the IBM Cloud Code Engine service using the
            specified parameters and external configuration.
     """
     authenticator = get_authenticator_from_environment(service_name)
     service = cls(authenticator)
     service.configure_service(service_name)
     return service
示例#7
0
 def new_instance(
     cls,
     service_name: str = DEFAULT_SERVICE_NAME,
 ) -> 'GlobalSearchV2':
     """
     Return a new client for the global_search service using the specified
            parameters and external configuration.
     """
     authenticator = get_authenticator_from_environment(service_name)
     service = cls(authenticator)
     service.configure_service(service_name)
     return service
示例#8
0
    def new_instance(
        cls,
        crn: str,
        service_name: str = DEFAULT_SERVICE_NAME,
    ) -> 'FirewallAccessRulesV1':
        """
        Return a new client for the Firewall Access Rules service using the
               specified parameters and external configuration.

        :param str crn: Full crn of the service instance.
        """
        if crn is None:
            raise ValueError('crn must be provided')

        authenticator = get_authenticator_from_environment(service_name)
        service = cls(crn, authenticator)
        service.configure_service(service_name)
        return service
    def __init__(
        self,
        authenticator: Authenticator = None,
        service_name: str = DEFAULT_SERVICE_NAME,
    ) -> None:
        """
        Construct a new client for the Natural Language Classifier service.

        :param Authenticator authenticator: The authenticator specifies the authentication mechanism.
               Get up to date information from https://github.com/IBM/python-sdk-core/blob/master/README.md
               about initializing the authenticator of your choice.
        """
        if not authenticator:
            authenticator = get_authenticator_from_environment(service_name)
        BaseService.__init__(self,
                             service_url=self.DEFAULT_SERVICE_URL,
                             authenticator=authenticator,
                             disable_ssl_verification=False)
        self.configure_service(service_name)
示例#10
0
    def new_instance(
        cls,
        crn: str,
        service_name: str = DEFAULT_SERVICE_NAME,
    ) -> 'GlobalLoadBalancerEventsV1':
        """
        Return a new client for the Global Load Balancer Events service using the
               specified parameters and external configuration.

        :param str crn: Full url-encoded cloud resource name (CRN) of resource
               instance.
        """
        if crn is None:
            raise ValueError('crn must be provided')

        authenticator = get_authenticator_from_environment(service_name)
        service = cls(crn, authenticator)
        service.configure_service(service_name)
        return service
    def new_instance(
        cls,
        crn: str,
        zone_id: str,
        service_name: str = DEFAULT_SERVICE_NAME,
    ) -> 'PageRuleApiV1':
        """
        Return a new client for the Page Rule API service using the specified
               parameters and external configuration.

        :param str crn: instance id.

        :param str zone_id: zone id.
        """
        if crn is None:
            raise ValueError('crn must be provided')
        if zone_id is None:
            raise ValueError('zone_id must be provided')

        authenticator = get_authenticator_from_environment(service_name)
        service = cls(crn, zone_id, authenticator)
        service.configure_service(service_name)
        return service
示例#12
0
    def new_instance(
        cls,
        crn: str,
        zone_id: str,
        service_name: str = DEFAULT_SERVICE_NAME,
    ) -> 'SecurityEventsApiV1':
        """
        Return a new client for the Security Events API service using the specified
               parameters and external configuration.

        :param str crn: Full url-encoded cloud resource name (CRN) of resource
               instance.

        :param str zone_id: zone identifier.
        """
        if crn is None:
            raise ValueError('crn must be provided')
        if zone_id is None:
            raise ValueError('zone_id must be provided')

        authenticator = get_authenticator_from_environment(service_name)
        service = cls(crn, zone_id, authenticator)
        service.configure_service(service_name)
        return service