.. meta:: :description: This documentation will guide you through the use of the Memset API. .. index:: double: Methods; cluster.real_service .. _cluster.real_service: Cluster Real Service Methods ---------------------------- API methods for cluster real services. .. function:: cluster.real_service.disable Disable the Cluster Server in the Cluster Service. :param cluster_name: Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters. :type cluster_name: String :param service_name: Name of the cluster service. :type service_name: String :param server_name: Name of the cluster server. :type server_name: String :returns: If the server is enabled, a dictionary as described in :func:`job.status`. :raises: May raise :class:`ApiErrorDoesNotExist` if the Cluster, Cluster Service or server does not exist. .. function:: cluster.real_service.disable_fallback Unset the Real Service as fallback. :param cluster_name: Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters. :type cluster_name: String :param service_name: Name of the cluster service. :type service_name: String :param server_name: Name of the cluster server. :type server_name: String :returns: If in fallback, a dictionary as described in :func:`job.status`. :raises: ApiErrorDoesNotExist if the Cluster, Cluster Service or Cluster Server does not exist (in the cluster/account). When in fallback mode, the real service is used when all other real services are down. Only one Real Service can be in fallback mode. .. function:: cluster.real_service.enable Enable the Cluster Server in the Cluster Real Service. :param cluster_name: Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters. :type cluster_name: String :param service_name: Name of the cluster service. :type service_name: String :param server_name: Name of the cluster server. :type server_name: String :returns: If the server is disabled, a dictionary as described in :func:`job.status`. :raises: May raise :class:`ApiErrorDoesNotExist` if the Cluster, Cluster Service or server does not exist. .. function:: cluster.real_service.enable_fallback Set the Real Service as fallback. :param cluster_name: Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters. :type cluster_name: String :param service_name: Name of the cluster service. :type service_name: String :param server_name: Name of the cluster server. :type server_name: String :returns: If not in fallback, a dictionary as described in :func:`job.status`. :raises: ApiErrorDoesNotExist if the Cluster, Cluster Service or Cluster Server does not exist (in the cluster/account). :raises: ApiErrorPreconditionFailed if a server in the Cluster Service is already set as fallback. :raises: ApiErrorPreconditionFailed if the Real Service is not enabled. When in fallback mode, the real service is used when all other real services are down. Only one Real Service can be in fallback mode. .. function:: cluster.real_service.info Information about a Cluster Real Service :param cluster_name: Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters. :type cluster_name: String :param service_name: Name of the cluster service. :type service_name: String :param server_name: Name of the cluster server. :type server_name: String :returns: a dictionary with the following keys: **ip_address** String: IP Address the service is listening on. **port** String: The port the service is on. **weight** Integer: The weight for this service. **fallback** Boolean: Whether this real service is set as a fallback. **enabled** Boolean: Whether this real service is enabled. When disabled, it is not part of the service. :raises: May raise :class:`ApiErrorDoesNotExist` if the cluster, Cluster Service, Cluster Real Service or Cluster Server does exist. .. function:: cluster.real_service.list List the Cluster Real Services for a given Cluster Service. FIXME: returns :param cluster_name: Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters. :type cluster_name: String :param service_name: Name of the cluster service. :type service_name: String .. function:: cluster.real_service.set_weight Change the weight of a server in the service. :param cluster_name: Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters. :type cluster_name: String :param service_name: Name of the cluster service. :type service_name: String :param server_name: Name of the cluster server. :type server_name: String :param weight: Weight is an integer specifying the capacity of a server (relative to the others in the pool). A weight of zero means that the server will not receive new jobs. :type weight: Integer :returns: If new weight is different to existing value, a dictionary as described in :func:`job.status`. :raises: ApiErrorDoesNotExist if the Cluster, Cluster Service or Cluster Server does not exist (in the cluster/account). .. function:: cluster.real_service.statistics Statistical information about a Cluster Real Service. :param cluster_name: Name of the cluster. Cluster names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters. :type cluster_name: String :param service_name: Name of the cluster service. :type service_name: String :param server_name: Name of the cluster server. :type server_name: String :returns: a dictionary with the following keys: **active** Boolean: Whether this real service is active in the cluster service. **active_connections** Integer: Current number of active connections **bps_in** Integer: Current bits per second in **bps_out** Integer: Current bits per second out **connections_per_second** Integer: Current number of connections per second **inactive_connections** Integer: Current number of inactive connections **last_update** Date (with time): The time the status was last updated **persistent_connections** Integer persistent connections - Current number of persistent connections **pps_in** Integer: Current number of packets per second in **pps_out** Integer: Current number of packets per second out :raises: May raise :class:`ApiErrorDoesNotExist` if the cluster, Cluster Service, Cluster Real Service or Cluster Server does exist. N.B. The data is not live and is thus always at least a few minutes out-of-date. This method can be polled frequently without concern for performance.