Module: RegApi2::Service

Extended by:
Service
Includes:
Builder
Included in:
Service
Defined in:
lib/reg_api2/service.rb

Overview

REG.API service category

Instance Method Summary (collapse)

Methods included from Builder

included

Instance Method Details

- (Hash(descr, service_id, ...)) create(opts = {})

Note:

Accessibility: everyone

Note:

Support of service lists: no

Use the function to order new services. TODO: specific options.

Examples:

Create srv_hosting_ispmgr service.

RegApi2.service.create dname: 'qqq.ru', servtype: :srv_hosting_ispmgr, period: 1, plan: 'Host-2-1209'

Parameters:

  • opts (defaults to: {})

    Options.

Options Hash (opts):

  • :domain_name (String)

    Name of the domain, for which the service is ordered.

  • :servtype (String, Symbol)

    The type of the ordered service.

    servtype service type
    srv_webfwd web forwarding
    srv_parking domain parking
    srv_dns_both DNS support
    srv_hosting_ispmgr ISPManager hosting
    srv_hosting_cpanel CPanel hosting
    srv_hosting_plesk PLesk hosting
    srv_ssl_certificate SSL certificate
    srv_certificate Domain certificate
    srv_voucher Domain voucher
    srv_vps VPS server
    srv_license_isp ISP Manager license
    srv_addip additional IP address
    srv_disk_space additional disk space
    srv_antispam advanced spam protection
    srv_dedicated dedicated server
    srv_kvm KVM access
  • :period (Object)

    The period for which the service is ordered, the unit of measurement (year or month) depends on the type of the service being ordered. To learn about the measurement units used for each service, use the #get_servtype_details function.

  • :user_servid (String)

    Domain ID set by the user. Allowed symbols: digits (from 0 through 9), Latin letters (from a through f). Maximum length: 32 symbols. This ID cannot be generated automatically; if it is not defined upon service ordering, the field will be empty. Optional field.

  • :point_of_sale (Object)
  • :pay_type (Object)
  • :ok_if_no_money (Object)
  • :folder_name (Object)

    Defines the name of the folder, to which the services will be added (see folder identification parameters).

  • :folder_id (Object)

    Defines the name of the folder, to which the services will be added (see folder identification parameters).

  • :no_new_folder (Boolean)

    Dont't create non-existing folder; otherwise create if not exists.

  • :comment (String)

    An arbitrary text describing the order. Optional field.

  • :admin_comment (String)

    A comment for administrators. An arbitrary text describing the order. Optional field.

Returns:

  • (Hash(descr, service_id, ...))

    Information about ordered service.

See Also:



95
# File 'lib/reg_api2/service.rb', line 95

define :create, required: %w[ servtype ]

- (void) delete(opts = {})

Note:

Accessibility: clients

Note:

Support of service lists: no

This method returns an undefined value.

Removes the service.

Examples:

Removing of srv_hosting_ispmgr service.

RegApi2.service.delete domain_name: 'test.ru', servtype: :srv_hosting_ispmgr

Parameters:

  • opts (defaults to: {})

    Options.

Options Hash (opts):

  • :servtype (String, Symbol)

    Service type, which is to be removed. These values are supported:

    servtype service type
    srv_hosting_ispmgr ISPManager hosting
    srv_hosting_cpanel CPanel hosting
    srv_hosting_plesk PLesk hosting
    srv_addip additional IP address
    srv_antispam advanced spam protection
    srv_sitebuilder_plsk SiteBuilder Plesk
    srv_vps VPS server
    srv_license_isp ISP Manager license
    srv_disk_space additional disk space
    srv_dedicated dedicated server
    srv_kvm KVM access


121
# File 'lib/reg_api2/service.rb', line 121

define :delete, required: %w[ servtype ]

- (Hash) get_bills(opts = {})

Note:

Accessibility: partners

Note:

Support of service lists: yes

Use this function to get a list of invoices associated with the defined services.

Examples:

Get invoices and services for qqq.ru domain.

RegApi2.service.get_bills dname: "qqq.ru"

Parameters:

  • opts (defaults to: {})

    Options.

Returns:

  • (Hash)

    List of invoices associated with the defined services.

    Field Description
    services A list of requested services.
    bills A list of IDs of invoices associated with this service. May be nil.


223
# File 'lib/reg_api2/service.rb', line 223

define :get_bills

- (Array<Hash>) get_dedicated_server_list(opts = {})

Note:

Accessibility: clients

Note:

Support of service lists: no

Get the dedicated server list.

Examples:

Get list of dedicated servers

RegApi2.service.get_dedicated_server_list

Parameters:

  • opts (defaults to: {})

    Options.

Returns:

  • (Array<Hash>)

    List of dedicated servers. Each item of RegApi2::SymHash class contain these fields:

    Field Description
    server_id Unique server id
    cpu_content Processor model
    cpu_count Processor count
    cpu_core Core count
    ram_content RAM type
    ram_count RAM count
    ram_size RAM size
    hdd_content HDD interface type
    hdd_count HDD count
    hdd_size HDD disk size
    month_traf Traffic, GB per month
    price_retail Rent per month


197
# File 'lib/reg_api2/service.rb', line 197

define :get_dedicated_server_list, field: :server_list

- (Object) get_depreciated_period(opts = {})

Note:

Accessibility: clients

Note:

Support of service lists: no

Use this function to calculate the number of periods till the service expiration date.

Parameters:

  • opts (defaults to: {})

    Options.



254
# File 'lib/reg_api2/service.rb', line 254

define :get_depreciated_period

- (Object) get_details(opts = {})

Use this function to get detailed information about the service, including contact data for domains.

Parameters:

  • opts (defaults to: {})

    Options.



165
# File 'lib/reg_api2/service.rb', line 165

define :get_details

- (Object) get_folders(opts = {})

Use this function to get the list of folders the service is associated with.

Parameters:

  • opts (defaults to: {})

    Options.



160
# File 'lib/reg_api2/service.rb', line 160

define :get_folders

- (Object) get_info(opts = {})

Note:

Accessibility: clients

Note:

Support of service lists: yes

Use this function to obtain information about all services.

Parameters:

  • opts (defaults to: {})

    Options.



128
# File 'lib/reg_api2/service.rb', line 128

define :get_info

- (Array<Hash>) get_list(opts = {})

Note:

Accessibility: clients

Use this function to obtain a list of active services.

Examples:

Get list of domains.

RegApi2.service.get_list servtype: :domain

Parameters:

  • opts (defaults to: {})

    Options.

Options Hash (opts):

  • :servtype (String, Symbol)

    Type of service. If nothing is defined, information about all types of services will be returned.

    Type Description
    domain Domain
    srv_webfwd web forwarding
    srv_parking domain parking
    srv_dns_both DNS support
    srv_hosting_ispmgr ISPManager hosting
    srv_hosting_cpanel CPanel hosting
    srv_hosting_plesk Plesk hosting
    srv_antispam Extended spam protection
    srv_vps VPS server
    srv_addip Additional IP address
    srv_license_isp ISPManager license
    srv_certificate Domain certificate
    srv_voucher Domain voucher

Returns:

  • (Array<Hash>)

    List of service of specified servtype.



155
# File 'lib/reg_api2/service.rb', line 155

define :get_list, field: :services

- (Hash(currency, price_group, show_renew_data, prices)) get_prices(opts = {})

Note:

Accessibility: everyone

Note:

Support of service lists: no

Get services registration/renewal prices.

Examples:

Get prices.

RegApi2.service.get_prices

Parameters:

  • opts (defaults to: {})

    Options.

Options Hash (opts):

  • :show_renew_data (Boolean)

    With this flag enabled the system will return the price of renewal (1/0). Optional field.

  • :currency (String, Symbol)

    Identifier of the currency in which the prices will be quoted: rur (default), uah, usd, eur. Optional field.

Returns:

  • (Hash(currency, price_group, show_renew_data, prices))

    Prices.



37
# File 'lib/reg_api2/service.rb', line 37

define :get_prices

- (Array(Hash(commonname, ...))) get_servtype_details(opts = {})

Note:

To obtain prices for several service types, you can define them in the servtype field delimiting them with commas or include several servtype fields into the request. In this case the field subtype is ignored.

Note:

Accessibility: everyone

Use this function to get prices for services and general data.

Examples:

Get service type details.

RegApi2.service.get_servtype_details servtype: :srv_hosting_ispmgr

Parameters:

  • opts (defaults to: {})

    Options.

Options Hash (opts):

  • :servtype (String, Symbol)

    Type of service: srv_webfwd — web forwarding, srv_parking — domain parking, srv_dns_both — DNS support, srv_hosting_ispmgr — hosting, srv_certificate — domain certificate, srv_voucher — domain voucher, srv_kvm — KVM access.

  • :subtype (String, Symbol)

    Service subtype.

  • :unroll_prices (Boolean)

    Show prices in expanded form.

Returns:

  • (Array(Hash(commonname, ...)))

    Service type details.



50
# File 'lib/reg_api2/service.rb', line 50

define :get_servtype_details

- (Array<Hash>) nop(opts = {})

Note:

Accessibility: clients

Note:

Support of service lists: yes

Return list of specified services with its stats if specified.

Examples:

List of services by specified identifiers

RegApi2.service.nop(services: [
  { dname:"test.ru" },
  { dname: "test.su", servtype: "srv_hosting_ispmgr" },
  { service_id: 111111 },
  { service_id: "22bug22" },
  { surprise: "surprise.ru" }
])

Parameters:

  • opts (defaults to: {})

    Options.

Options Hash (opts):

  • services (Array<Hash>)

    List of services to be retrieved.

Returns:

  • (Array<Hash>)

    List of specified services with its stats.



25
# File 'lib/reg_api2/service.rb', line 25

define :nop, field: :services

- (Object) partcontrol_grant(opts = {})

Note:

Accessibility: clients

Note:

Support of service lists: no

You can use this function to grant a part of service management rights to other users.

Parameters:

  • opts (defaults to: {})

    Options.



268
# File 'lib/reg_api2/service.rb', line 268

define :partcontrol_grant

- (Object) partcontrol_revoke(opts = {})

Note:

Accessibility: clients

Note:

Support of service lists: no

Use this function to stop granting service management rights to other.

Parameters:

  • opts (defaults to: {})

    Options.



275
# File 'lib/reg_api2/service.rb', line 275

define :partcontrol_revoke

- (Hash(service_id, bill_id etc.)) refill(opts = {})

Note:

Accessibility: clients

Note:

Support of service lists: no

You can use this function to refill balance of you service. Only Jelastic (srv_jelastic) is supported at the moment.

Examples:

Refill by service id.

RegApi2.service.refill service_id: 123456, amount: 10, currency: 'UAH'

Parameters:

  • opts (defaults to: {})

    Options.

Options Hash (opts):

  • service_id (Fixnum)

    Service id to be refilled.

  • amount (Number)

    Amount of the invoice.

  • currency (String)

    Invoice currency (RUR, USD, EUR, UAH).

  • ok_if_no_money (Boolean)

    Enable to create bill when not enough funds to complete the operation. In this case requested operation is stored in the system, however it will be processed after submitting "change payment method" request via web interface. Return error if this flag not set and not enough funds to complete the operation.

Returns:

  • (Hash(service_id, bill_id etc.))


300
# File 'lib/reg_api2/service.rb', line 300

define :refill

- (Object) renew(opts = {})

Domain or service renewal.

Parameters:

  • opts (defaults to: {})

    Options.



207
# File 'lib/reg_api2/service.rb', line 207

define :renew

- (Hash(service_id, dname)) resend_mail(opts = {})

Note:

Accessibility: clients

Note:

Support of service lists: no

Resend mail to user.

Examples:

Resend mail.

RegApi2.service.resend_mail servtype: :srv_ssl_certificate

Parameters:

  • opts (defaults to: {})

    Options.

Options Hash (opts):

  • mailtype (Array)

    Email type: approver_email — approve ssl certificate order, certificate_email — certificate email.

Returns:

  • (Hash(service_id, dname))


286
# File 'lib/reg_api2/service.rb', line 286

define :resend_mail

- (void) resume(opts = {})

Note:

Accessibility: clients

Note:

Support of service lists: no

This method returns an undefined value.

Use this function to resume services (for domains – resume domain delegation).

Parameters:

  • opts (defaults to: {})

    Options.



247
# File 'lib/reg_api2/service.rb', line 247

define :resume

- (Object) service_get_details(opts = {})

Deprecated.

Use #get_info instead.

You can use this function to obtain general information about the ordered service, as well as additional data about the hosting and web forwarding services. It is an obsolete function. For the major part of service it is advisable to use the #get_info function instead.

Parameters:

  • opts (defaults to: {})

    Options.



171
# File 'lib/reg_api2/service.rb', line 171

define :service_get_details

- (void) set_autorenew_flag(opts = {})

Note:

Accessibility: clients

Note:

Support of service lists: no

This method returns an undefined value.

Enables or disables automatic service renewal.

Parameters:

  • opts (defaults to: {})

    Options.



231
# File 'lib/reg_api2/service.rb', line 231

define :set_autorenew_flag

- (void) suspend(opts = {})

Note:

Accessibility: clients

Note:

Support of service lists: no

This method returns an undefined value.

Use this function to suspend services (for domains – suspend delegation).

Parameters:

  • opts (defaults to: {})

    Options.



239
# File 'lib/reg_api2/service.rb', line 239

define :suspend

- (Object) update(opts = {})

Service configuration.

Parameters:

  • opts (defaults to: {})

    Options.



202
# File 'lib/reg_api2/service.rb', line 202

define :update

- (Object) upgrade(opts = {})

Note:

Accessibility: clients

Note:

Support of service lists: no

This function upgrades service subtypes (rate plans). It can be used for changes of rate plans for virtual hosting ("srv_hosting_ispmgr"), VPS servers("srv_vps") and Additional Disk Space for VPS ("srv_disk_space").

Parameters:

  • opts (defaults to: {})

    Options.



261
# File 'lib/reg_api2/service.rb', line 261

define :upgrade