These API methods allow you to order Memset services.
Warning
Please use the dry_run=True argument when you are testing, so that invoices are not generated.
When creating services using the API, the default payment method for your Memset account will be used. The following constraints on the account payment method apply when using the API to create products:
- A card or billing account must be used to create services which are billed in arrears.
- It is not possible to use PayPal when creating services
If you have consolidated billing enabled for your account, any charges will be added to your next consolidated bill by default. If you wish to be invoiced immediately, you can set add_to_next_bill=False, and the default payment method for your Memset account will be used.
See Payment Method Methods for more information on the payment methods API.
When provisioning servers, you must include the required os parameter. The os parameter can be set to one of our stock operating systems or the name of a Memstore snapshot. For a list of our supported operating systems and the required API names, please see our Operating Systems page for more information.
If you wish to provision a server using a snapshot, please obtain the name of the snapshot using server.snapshot_list() and specify the os_option as the value for os.
See create.monthly_miniserver(), create.hourly_miniserver() and create.monthly_fullserver() for the list of available operating systems for each service type.
We offer cPanel as a chargeable extra for monthly servers, but not hourly Miniservers. Our cPanel image is based on 64-bit CentOS 7.
To specify that you want cPanel, you must specify os=centos7_cpanel_64.
returns: | A dictionary with the following keys
|
---|
The following example shows how to create a monthly miniserver.
First we call create.monthly_miniserver() with dry_run=True:
{
"sku": "MSVM001",
"os": "debian_jessie_64",
"dry_run": true,
}
This will return a response similar to the following:
{
'sku': u'MSVM001'
'currency': u'GBP',
'dry_run': True,
'net_setup_price': 0,
'net_total': 7.50,
}
If we are happy, we can make the same request, but this time with dry_run=False so that the service is actually created:
{
"sku": "MSVM001",
"os": "debian_jessie_64",
"dry_run": false
}
This will give a response similar to the following:
{
'sku': u'MSVM001'
'currency': u'GBP',
'dry_run': False,
'invoice_ref': 100291,
'job': {'error': False,
'finished': False,
'id': '739c99f25ed8d13e48ba94ec6a4a0102',
'status': 'AWAITING-PAYMENT',
'type': 'SETUP-NEW-MINISERVER'},
'net_setup_price': 0,
'net_total': 7.50
}
Note that a job has been created to set up the miniserver, with the status AWAITING-PAYMENT. Once the invoice has been paid, we can check the progress of the setup using the job.status() method.
If we provide an invalid parameter, an ApiErrorBadParameters() exception will be raised. For example, let’s try to provision a Miniserver with Windows and 1GB RAM.:
{
"sku": "MSVM001",
"os": "win2012serverstd_r2_64",
"dry_run": false,
}
This is an invalid configuration, as Windows miniservers require at least 2 GB of RAM. Therefore we get an exception:
ApiErrorBadParameters: os: Please select a valid choice. Microsoft Windows 2012 Server R2, Standard Edition is not available for the current configuration. Windows requires at least 2 GB RAM.
Returns the services which can be provisioned using the API.
Returns: | a list of dictionaries for each available service with the
following keys
|
---|
Adds bandwidth to a server’s extra bandwidth bank.
The bandwidth bank is an additional pool of metered bandwidth that will only be used in the event that your monthly inclusive quote is exceeded. It is designed as a “top up tank” in case you have extra usage in any one month.
This is only valid for servers with metered bandwidth_type.
Parameters: |
|
---|
Warning
Our hourly Miniserver VM products are now deprecated and will be removed in a future API release. For cloud compute instances billed by the hour, please view our new Openstack Public Cloud product: https://www.memset.com/hosting-services/cloud/openstack/
Note that the os, firewall, intrusion_detection and disk_type options affect the price per hour.
Parameters: |
|
---|
Provisions a Memstore instance.
See the Memstore cloud storage page for pricing and more information.
Parameters: |
|
---|
Provisions a full server for a period of months.
See the Fully Dedicated Server packages page for pricing and more information.
Note that the following optional extras will affect the monthly price: os, firewall, disk, ram, net_card_speed_gbps, bandwidth_type, connection, monthly_transfer_gb, period support_level, monitoring_level, backups, vulnscan, database and antivirus.
Parameters: |
|
---|
Provisions a Miniserver VM instance for a period of months.
See the Miniserver VM packages page for pricing and more information.
Warning
Please note that the following parameters are deprecated and only supported for our classic Miniservers (e.g. skus beginning with MS0):
disk_type, disk_gb, bandwidth_type, connection, monthly_transfer_gb
The following optional extras will affect the monthly price: os, firewall, disk_type, disk_gb, bandwidth_type, connection, monthly_transfer_gb, period, support_level, monitoring_level, backups, vulnscan, database, antivirus and intrusion_detection
Parameters: |
|
---|
Provisions a Cloud IaaS (powered by OpenStack) project.
See the Cloud IaaS page for pricing and more information.
Parameters: |
|
---|
Returns information about a discount code.
Parameters: | discount_code (String) – Discount code to verify. |
---|---|
Returns: | if the discount code is valid, this method returns a dictionary with
following keys:
|
In order to see how a discount code affects a product price, use the appropriate create method providing the discount code and setting dry_run parameter to True.
Raises : | ApiErrorDoesNotExist if the discount code doesn’t exist or is not valid for this account. |
---|