.. meta:: :description: This documentation will guide you through the use of the Memset API. .. index:: double: Methods; service .. _service: Service Methods --------------- API for Services .. function:: service.cancel Cancels a service. :param name: Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters. :type name: String :returns: A dictionary as described in :func:`job.status`. :raises: May raise :class:`ApiErrorAlreadyInProgress` if the service is pending cancellation. A cancellation invoice may be generated. SSL Certificates are not supported and can't be cancelled with this method. .. function:: service.info Describes the service returning a list of dictionaries. :param name: Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters. :type name: String :returns: A dictionary with the following keys: **name** String: The canonical name of this service. For servers this is also the server name. **status** String: The status of the service as a string e.g. "LIVE", "ONHOLD", "CANCELLED". **nickname** String: The nickname of the service - set by the customer, defaults to "". **start_date** Date: The start date of the service. **expiry_date** Date: The end date of the service. **renewal_price_amount** Float: The monetary amount for the monthly renewal including VAT. **renewal_price_currency** String: The currency for the renewal, e.g. "GBP". **renewal_price_vat** Float: The monetary amount for VAT on the monthly renewal. **type** String: The type of this service, e.g. "fullserver", "miniserver", etc. **network_zones** List of strings: The names of all the network zones associated to this service (if any). Some services are network zone independent. **data_zone** String: The name of the data zone this service is in (if applicable). Some services that don't have data at rest are data zone independent and this field will be empty. .. function:: service.list List all the services for an account. :param type: Search only for this type of service, by default all services are returned. :type type: String or List, Optional :param status: Status of the service to look for, default 'LIVE'. Acceptable values: 'LIVE', 'CANCELLED'. :type status: String, Optional :returns: a list of dictionaries where each dictionary is as described in :func:`service.info`. .. function:: service.set_nickname Updates the service nickname. :param name: Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters. :type name: String :param nickname: New nickname for the service. :type nickname: String :returns: a dictionary with the following keys: **nickname** String: The new nickname for the service. This enforces that the nickname must be unique for all the services of the same account. The nickname must be made up of the characters [A - Z a - z 0 - 9 _ . - ']. Any characters not in this range will be deleted. It must be 255 characters or fewer - any extra will be truncated. Any leading or trailing whitespace will be removed. It must be unique for the services in the account - if not it returns :class:`ApiErrorNotUnique`. The nickname set is returned.