BOSS API documentation213-239-2247

This file was generated Mar 11, 2017 for version 0.1.0.1

Branch: <branch> (<commit>)

87230833114067952725

str
Any utf-8 encoding string
Date

Date and time type. The following formats are supported:

  • ISO format – 2013-01-28T00:37:12
  • ISO format without delimiter – 20130128003712
  • Unix Timestamp – 1359718708 (2013-02-01 5:38:28)
Day

Date type. The following formats are supported:

  • ISO format – 2013-01-28
  • ISO format without delimiter – 20130128
  • Unix Timestamp – 1359331200 (2013-01-28 00:00:00). Hours, Minutes, and seconds must me zero.
Email
User email. It must match to RFC 822
Regexp
String type which should match to Perl-compatible regular expression
Role
User role

4078714786(805) 299-2186

Name Code Message
AssignMutableTariff 409 Изменяемый тариф не может быть назначен заказчику / Mutable plan cannot be assigned to a customer
BackupScheduleVolumeNotFound 404 Диск не найдет / The volume is not found
BadParameter 400
BadRequest 400
BotVerifyFailed 401 Invalid reCAPTCHA token. You are bot.
CacheDatabaseIsDown 503 Отказ кэширующей базы. Пожалуйста, попробуйте позднее / Cache database is down. Please try again a bit later
Conflict 409
CustomerAlreadyExists 409 Заказчик уже существует / Customer account already exists
CustomerBlocked 409 Заказчик заблокирован / Customer is blocked
CustomerEmailIsNotConfirmed 409 Email заказчика не подтвержден / Customer email is not confirmed
CustomerInvalidToken 401 Некорректный токен / Invalid token
CustomerIsNotEntity 409 Заказчик не юридическое лицо / Customer is not entity
CustomerIsNotRemoved 409 Заказчик не удален / Customer is not removed
CustomerNotFound 404 Заказчик не найден / Customer account not found
CustomerPaymentCardAlreadyExists 409 Платежная карта уже существует / Payment card already exists
CustomerRemoved 409 Заказчик удален / Customer is removed
CustomerTypeIsProhibited 409 Регистария заказчиков данного типа ограничена. / The registration of this type customer is prohibited.
CustomerUnauthorized 401 Некорректные почта или пароль / Incorrect email/password
CustomerWithoutHorizonUser 400 У пользователя нет учетной записи для доступа к облаку OpenStack. Пожалуйста, обратитесь к администратору. / Customer has no OpenStack login. Please contact the administrator.
DatabaseIsDown 503 Отказ базы данных. Пожалуйста, попробуйте позднее / Database is down. Please try again a bit later
EmailConfirmationTokenInvalid 400 Ссылка для подтверждения почтового адреса неверена, просрочена или уже использована. Попробуйте запросить подтверждающее письмо еще раз / Email confirmation link is invalid, expired or was already used. Please try to resend a confirmation email
FileIsTooLarge 409 Файл слишком большой. Максимальный поддерживаемый размер {} / File is too large. Max supported size is {}
FlavorAlreadyExists 409 Флавор уже существует / Flavor already exists
FlavorNotFound 404 Флавор не найден / Flavor not found
Forbidden 403
HarakiriIsNotAllowed 403 Не возможно удалить самого себя / Can not delete self
HasToHaveDefinedNameInDefaultLanguage 409 Должен иметь перевод для языка по умолчанию: ‘{}’ / Has to have translation for default language: ‘{}’
HorizonRequestError 400 Подключение к облаку OpenStack закончилось неудачей. Пожалуйста, обратитесь к администратору. / Unsuccessful request to Horizon. Please contact the administrator.
HorizonUnauthorized 400 Невозможно авторизоваться в облаке OpenStack с текущей парой логин/пароль. Пожалуйста, обратитесь к администратору. / Unable to login into Horizon the current OpenStack login/password. Please contact the administrator.
ImmutableService 409 Неизменяемая услуга не может быть изменена / Immutable service cannot be changed
ImmutableTariff 409 Неизменяемый тариф не может быть изменен / Immutable plan cannot be changed
InvalidMoney 400 Неверный формат значения / Invalid number format
InvalidSubscription 400 Неправильный формат подписной информации / Invalid subscription data
InvoiceFileNotFound 404 Файл для инфойса не найден / Invoice file not found
InvoiceImmutable 409 Счет не может быть изменен / The invoice is immutable
InvoiceIsNotPayable 409 Счет не может быть оплачен / Invoice is not payable
InvoiceNotFound 404 Счет не найден / Invoice not found
LockedFieldCantBeModified 400 Fields individual_tax_number, primary_state_registration_number can’t be modified
MessageTemplateError 400 Ошибка генерации шаблона / Error while rendering a template
MethodNotAllowed 405
MethodNotImplemented 405 Метод еще не реализован / Method is not implemented
MutableTariffCantBeDefault 409 Неизменяемый тариф не может быть тарифом по умолчанию / Mutable plan cannot be default
NewsAlreadyExist 409 Новость уже существует / The news already exists
NewsNotFound 404 Новость не найдена / News not found
NotAcceptable 406
NotFound 404 Не найден / Not Found
NothingForUpdate 400 Не заданы параметры для обновления / Nothing to update
OnlyImmutableService 409 Только неизменяемая услуга может быть вклюена в тариф / Only immutable service can be included in plan
OpenstackPasswordWrong 404 Пароль от openstack не правильный. Вы можете его сменить в вашем профайле / Openstack password is wrong. You can reset password from your profile
OptionAlreadyExists 409 Опция уже существует / Option already exists
OsFlavorExistsWithDifferentParams 409 Флавор уже существует в OS с другими параметрами / Flavor already exists in OS with different parameters
ParentTariffCurrency 409 Родительский тариф должен быть с той же валютой / Parent plan should have the same currency
PasswordResetTokenInvalid 400 Ссылка для восстановления пароля неверена, просрочена или уже использована. Попробуйте восстановить пароль еще раз / Password reset link is invalid, expired or was already used. Please try to request password reset again
PaymentCardNotFound 409 Платежная карта не найдена / Payment card not found.
PaymentCardRemoved 409 Платежная карта уже удалена / Payment card already removed.
PaymentRequired 402
ProductionModeNeedMoreInfo 400 Для перехода в продуктовый режим необходимо заполнить все обязательные поля / Need to fill in all mandatory fields to switch to production mode.
PromocodeInvalid 401 Некорректный промо-код. / Invalid promo code.
PromocodeOnly 400 Регистрация только по промо-кодам. / Registration with promo code only.
PromocodeRemoved 409 Промокод уже удален / Promo code already removed
QuotaAlreadyExist 409 Квота для этого заказчика уже существует / Quota for this customer already exists
RemoveUsedTariff 409 Тариф используется и не может быть удален / Used plan cannot be removed
RemovedNews 409 Удаленная новость не может быть изменена / Removed news cannot be changed
RemovedService 409 Удаленная услуга не может быть изменена / Removed service cannot be changed
RemovedServiceInTariff 404 Удаленная услуга не может быть добавлена в тариф / Removed service cannot be included in plan
RemovedTariff 409 Удаленный тариф не может быть изменён / Removed plan cannot be changed
RemovingUsedService 409 Услуга используется и не может быть удалена / Used service cannot be removed
ReportAggregationIsNotReady 404 Отчет еще не готов / Report aggregation is not ready
ReportFormatIsNotSupported 409 Запрашиваемый формат отчета не поддерживается / Report format is not supported
RoleNotFound 404 Роль не найдена / Role not found
SendingEmailException 409 Отправка письма невозможна / Email sending is impossible
ServiceAlreadyExisted 404 Сервис уже существует / Service already exists
ServiceNotFound 404 Услуга не найдена / Service not found
ServiceUnavailable 503
StartShouldBeEarlierFinish 400 Параметр start должен быть меньше чем finish / start parameter should be earlier than finish
SubscriptionAlreadyExists 409 Подписка уже существует / Subscription already exists
SubscriptionNotFound 400 Id подписки не найдено / Subscription id is not found
SubscriptionSwitchAlreadyExists 409 Подписка уже существует / Subscription already exists
TariffAlreadyExists 409 Тариф уже существует / Plan already exists
TariffHistoryNotFound 404 Запись истории тарифа не найдена / Plan history entry not found
TariffNotFound 404 Тариф не найден / Plan not found
TenantIsnotCreated 409 Tenant не создан еще. Пожалуйста, попробуйте позднее / Tenant is not created yet. Try again latter
Timeout 408
TooManyLoginAttempts 403 Слишком много попыток залониниться. Пожалуйста подтвердите что вы не бот. / To many login attempts. Please confirm that you are not bot.
Unauthorized 401
UnknownServiceInSubscription 400 Сервис {} неизвестен / Service {} is unknown
UpdateAllowedInTestModeOnly 400 Редактирование контактной информации доступно только не продуктовом режиме. Пожалуйста обратитесь к своему менеджеру / You could edit your contact information only in test mode. Please, contact to your account manager
UserAlreadyExists 409 Пользователь уже существует / User account already exists
UserInvalidRole 405 Недостаточно прав для выполнения этого действия / Not enough rights to perform this action
UserInvalidToken 401 Некорректный токен / Invalid token
UserNotFound 404 Пользователь не найден / User account not found
UserRemoved 409 Пользователь удален / User account is removed
UserUnauthorized 401 Некорректные почта или пароль / Incorrect email/password
YandexMoneyHashMismatch 409 Хэш не совпадает / Hash is not matched
YandexMoneyInvalidLabel 409 Неизвестный заказчик в платежке / Unknown customer id in the pay
YandexMoneyNotSupportedCurrency 409 Валюта не поддерживается / Currency not supported

Short API descriptionascriptitii

Methods marked service method are available only in development environment (api.internal_methods_enabled = true in the config file).

CloudPaymentsApi
POST /api/0/payments/cloudpayments/check Checks payment availability for customer
POST /api/0/payments/cloudpayments/pay Checks payment availability for customer.
CurrencyApi
DELETE /api/0/currency Remove currency from active list (NOT IMPLEMENTED)
4184379144 Returns list of currency
GET /api/0/currency/active Return list of active currencies
POST /api/0/currency Add currency to list of available (NOT IMPLEMENTED)
CustomerApi
DELETE /api/0/customer/<customer> Remove customer
DELETE /api/0/customer/<customer>/deferred Cancel deferred changes for customer.
270-426-6205 Return filtered customer list.
412-696-6207 Return customer info of current customer
GET /api/0/customer/<customer>/balance/history Return list of account changes.
403-532-1175 Returns deferred changes for customer.
GET /api/0/customer/<customer>/history Returns customer profile history
(972) 265-6251 Returns auto withdraw parameters for specified customer.
2145133105 Returns customer’s limits.
GET /api/0/customer/<customer>/subscribe Returns info about customer’s subscriptions to user
GET /api/0/customer/<customer>/tariff Return tariff description for the customer
OPTIONS /api/0/auth
OPTIONS /api/0/customer
POST /api/0/customer Registration of new customer.
POST /api/0/customer/<customer>/_fake_usage Add fake withdraw for test report generation
POST /api/0/customer/<customer>/deferred/force Force to apply deferred changes for the customer.
(773) 448-1567 Generate invoice for customer
7324978415 Set customer to production mode from admin panel.
POST /api/0/customer/<customer>/payments/auto_withdraw Change auto withdraw balance limit and payment amount for specified customer
813-636-1222 Applies quota template to customer
POST /api/0/customer/<customer>/recreate_tenant Recreate tenant in Open Stack for specified customer
POST /api/0/customer/<customer>/report Asynchronous generate customer usage report for the period.
POST /api/0/customer/<customer>/restore Restore removed customer
pseudoconglomeration Update customer profile from admin panel.
PUT /api/0/customer/<customer>/balance Manual balance change.
PUT /api/0/customer/<customer>/block Block or unblock specific customer
PUT /api/0/customer/<customer>/confirm_email Send confirmation email to customer.
(888) 320-2162 Update deferred changes for customer.
PUT /api/0/customer/<customer>/quota This method allows changing customer’s resources limits by user with role >=Manager
7873222374 Update customer’s subscriptions by user.
PUT /api/0/customer/group Group update of customer profiles from admin panel.
ExchangeApi
DELETE /api/0/customer/<customer>/service_subscription/<subscription>/exchange/box/<box> Add email box
vulgar establishment Add email box
hitless Add email box
GraphiteApi
GET /api/0/graphite/metrics/find
GET /api/0/graphite/render
(217) 220-3921
POST /api/0/graphite/render
InvoiceApi
8089871078 Delete file
3366695958 List invoices for customer
GET /api/0/customer/<customer>/payments/invoice/<invoice>/<filename> Get attached to invoice file
POST /api/0/customer/<customer>/payments/invoice Add invoice for the customer
PUT /api/0/customer/<customer>/payments/invoice/<invoice> Update invoice for the customer
PUT /api/0/customer/<customer>/payments/invoice/<invoice>/complete Complete invoice
PUT /api/0/customer/<customer>/payments/invoice/<invoice>/invalid Complete invoice
PUT /api/0/customer/<customer>/payments/invoice/<invoice>/paid Mark the invoice as paid
NewsApi
787-542-1734 Deletes news with specified id
GET /api/0/news Returns news list
(410) 842-5831 Creates news
POST /api/0/news/<news> Publishes and unpublishes news with specified id
8553805119 Updates news with specified subject and body
ReportApi
(651) 444-2964 Returns IP address statistics.
(859) 240-7527 Asynchronous create an report that lists all receipts of funds for all customers
POST /api/0/report/usage Asynchronous create an report that lists used resources for all customers
(682) 341-0888 Returns customer statistics.
unlousy Asynchronous create an report that lists used resources by each customer.
ServiceApi
visible Archive service (only custom services can be deleted)
classifier Returns list of categories with localized names
GET /api/0/measure Returns list of measures
(703) 840-7173 Return filtered list of services.
GET /api/0/service/<service_id> Return service description
POST /api/0/service/custom Add new custom service.
4182027586 Add new flavor service.
PUT /api/0/service/<service>/custom Update custom service.
PUT /api/0/service/<service>/immutable Make service immutable.
PUT /api/0/service/<service>/vm Update Flavor.
ServiceSubscriptionApi
DELETE /api/0/customer/<customer>/service_subscription/<subscription> Delete subscription
(714) 452-6723 Get filtered list of subscription for the customer
GET /api/0/customer/<customer>/service_subscription/<subscription> Get customer subscription
GET /api/0/service_subscription Return filtered list of services.
(484) 238-1404 Return service description
908-296-3295 Create new subscription for the customer
PUT /api/0/customer/<customer>/service_subscription/<subscription> Update subscription for the customer
TariffApi
7852812697 Move the tariff to archive.
GET /api/0/tariff Returns paginated filtered tariff list.
GET /api/0/tariff/<tariff> Returns tariff info
GET /api/0/tariff/<tariff>/history Returns list of changes for tariff
GET /api/0/tariff/<tariff>/history/<history> Returns list of changes for tariff
GET /api/0/tariff/default Get description of default tariff
POST /api/0/tariff Create new tariff.
(301) 487-2370 Update tariff.
5023873418 Make tariff default
815-329-1843 Update tariff.
UserApi
DELETE /api/0/user/<user> Mark user as removed
(202) 545-8896 Mark myself user as removed
DELETE /api/0/user/password_reset Sent email with link to reset password
GET /api/0/user Return filtered user list.
(708) 279-1670 returns user info
Publican Return user info of current user.
GET /api/0/user/password_reset/<password_token> Checks that password reset token is valid.
OPTIONS /api/0/auth
POST /api/0/auth Auth user by email and password.
626-590-2207 Stop user session.
520-313-4817 Registration of new user.
obligatoriness Reset user password
PUT /api/0/user/<user> Update user profile of other user.
PUT /api/0/user/me Update user self profile.
UtilityApi
9027001723 Service method. It removes objects from db. Only tests should use it!
GET /api/0/country Return list of countries with internationalization
GET /api/0/event/<event>/allowed_period Returns list of allowed periods for events.
GET /api/0/health Checks health of services: db, redis, openstack
GET /api/0/language Return list of all languages
GET /api/0/language/active Return list of active languages
GET /api/0/locale/active Returns list of active locales.
GET /api/0/quotas/templates Get description of quotas templates
877-883-7172 Returns list of roles with internalization
GET /api/0/subscription Return list of subscriptions with internationalization
teethbrush
7862954285 List available timezones
GET /api/check_exception Service method, it raise exception to be sure that sentry and log system is configured as expected
GET /api/config.js Return config for frontend
907-599-7077
GET /api/version Returns current code version
(480) 453-0569
branchless Send email to specified email send_to with custom subject and body.
701-538-2053
YandexMoneyPaymentsApi
POST /api/0/payments/yandexmoney/check Check that payment is acceptable from yandex money
POST /api/0/payments/yandexmoney/pay Process payment from yandex money
9163372503 Process customer payments from yandex money
BackupApi
3867425066 Delete schedule for the specific volume
GET /lk_api/0/customer/me/backup/schedule Return list of configured backup schedule
8772525822 Create or update schedule for the specific volume
CustomerApi
DELETE /lk_api/0/customer/password_reset Sent email with link to reset password
DELETE /lk_api/0/customer/payments/cloudpayments/card Delete specified card from customer’s payment cards.
GET /lk_api/0/customer/me Return customer info of current customer
sponge-leaved Return list of account changes.
exegetical Method is checking if cookies is valid.
GET /lk_api/0/customer/me/os_token Return customers token info for OpenStack authorization.
GET /lk_api/0/customer/me/payments/auto_withdraw Returns auto withdraw parameters.
808-323-4155 Returns limits of current customer
GET /lk_api/0/customer/me/subscribe Returns info about customer’s subscriptions to customer
GET /lk_api/0/customer/me/tariff Return tariff description for the customer
GET /lk_api/0/customer/me/used_quotas Returns info about used resources in os.
(781) 788-6876 Checks that password reset token is valid.
GET /lk_api/0/customer/payments/cloudpayments/card Return customer’s payment cards
4125577912
OPTIONS /lk_api/0/customer
(867) 340-7520 Auth customer by email and password.
575-208-3867 Registration of new customer.
503-669-7799 Confirm customer email
POST /lk_api/0/customer/me/invoice Generate invoice for customer
(669) 207-5045 Set customer to production mode by current customer
720-646-1771 Change auto withdraw balance limit and payment amount.
POST /lk_api/0/customer/me/payments/withdraw Withdraw customer for given amount
816-749-8839 This method should be called by frontend just after sending request to create VM.
POST /lk_api/0/customer/me/post_vm_create_multi This method should be called by frontend just after sending request to create VM.
9293966490 Asynchronous generate customer usage report for the period.
509-551-8790 Reset customer password
POST /lk_api/0/customer/support Sends customer’s question to support
POST /lk_api/0/logout Stop customer session.
PUT /lk_api/0/customer/me Update customer self profile.
PUT /lk_api/0/customer/me/confirm_email Send confirmation email to yourself.
PUT /lk_api/0/customer/me/reset_os_password Resets Openstack password
PUT /lk_api/0/customer/me/subscribe Self update customer’s subscriptions.
CustomerServiceSubscriptionApi
pachyaemia Delete subscription
GET /lk_api/0/customer/me/service_subscription Get filtered list of subscription
GET /lk_api/0/customer/me/service_subscription/<subscription> Get customer subscription by id
POST /lk_api/0/customer/me/service_subscription Create new subscription for the customer
PUT /lk_api/0/customer/me/service_subscription/<subscription> Update subscription.
InvoiceApi
GET /lk_api/0/customer/me/payments/invoice List invoices for self customer
(713) 655-4716 Get attached to invoice file
NewsApi
GET /lk_api/0/news Returns news list
ResourceEventApi
888-976-9392 This method store events of creating/deleting resources in the cloud.
POST /lk_api/0/customer/me/event This method store events of creating/deleting resources in the cloud.
ServiceSubscriptionApi
620-546-2515 Return filtered list of services.
GET /lk_api/0/service_subscription/<service_id> Return service description
UtilityApi
DELETE /lk_api/0/_force_delete Service method. It removes objects from db. Only tests should use it!
GET /lk_api/0/event/<event>/allowed_period Returns list of allowed periods for events.
GET /lk_api/0/language Return list of all languages
(519) 345-2603 Return list of active languages
GET /lk_api/0/locale/active Returns list of active locales.
402-346-1578
GET /lk_api/favicon.ico
GET /lk_api/version Returns current code version
6036019136
VMPasswordApi
3124505648 Hash the password

Detailed API description¶

Detailed description of BOSS API

Note

Admin user is created by the following command

bin\bossmngr defaultadmin --email=ADMIN_EMAIL --password=ADMIN_PASSWORD

If –email or –password parameters are not passed, the default values from configs are used.

default_admin:
  • email: password:

premorbid5107027862

heat-cracked¶

POST /api/0/payments/cloudpayments/check(TransactionId, Amount, Currency, InvoiceId, AccountId, SubscriptionId, Name, Email, DateTime, IpAddress, IpCountry, IpCity, IpRegion, IpDistrict, CardFirstSix, CardLastFour, CardType, CardExpDate, Issuer, IssuerBankCountry, Description, Data, TestMode, Status)740-785-6074
Checks payment availability for customer
Parameters must be sent as json object.
Parameters:
  • TransactionId (Int) – Mandatory - System transaction number.
  • Amount (Numeric) – Mandatory - Payment amount from widget. Dot as separator, two digits after dot.
  • Currency (String) – Mandatory - Currency: RUB/USD/EUR/GBP from widget parameters.
  • InvoiceId (String) – Not mandatory - Order number from widget parameters.
  • AccountId (String) – Mandatory - Customer identifier from widget parameters.
  • SubscriptionId (String) – Not mandatory - Subscription identifier from widget parameters (for recurrent payments).
  • Name (String) – Not mandatory - Card holder name.
  • Email (String) – Payer’s e-mail
  • DateTime – Mandatory - Payment creation date/time in UTC (yyyy-MM-dd HH:mm:ss).
  • IpAddress (String) – Not mandatory - Payer IP-address
  • IpCountry (String) – Not mandatory - Payer’s country double-chars code (according to ISO3166-1)
  • IpCity (String) – Not mandatory - Payer’s city
  • IpRegion (String) – Not mandatory - Payer’s region.
  • IpDistrict (String) – Not mandatory - Payer’s district.
  • CardFirstSix (String) – Mandatory - Credit card first 6 digits
  • CardLastFour (String) – Mandatory - Credit card last 6 digits
  • CardType (String) – Mandatory - Card payment system: Visa or MasterCard or Maestro
  • CardExpDate (String) – Mandatory - Card expiration date MM/YY
  • Issuer (String) – Not mandatory - Issuer bank name
  • IssuerBankCountry (String) – Not mandatory - Issuer bank country double-char code (according to ISO3166-1)
  • Description (String) – Not mandatory - Payment description from widget parameters.
  • Data (Json) – Not mandatory - Any json-data from widget.
  • TestMode (Bit) – Mandatory - Test mode flag (1 or 0)
  • Status (String) – Mandatory - Payment status: Completed — for single-step, Authorized — for double-step.
Return:

Status code, looks like {‘code’: 0}


POST /api/0/payments/cloudpayments/pay(TransactionId, Amount, Currency, InvoiceId, AccountId, SubscriptionId, Name, Email, DateTime, IpAddress, IpCountry, IpCity, IpRegion, IpDistrict, CardFirstSix, CardLastFour, CardType, CardExpDate, Issuer, IssuerBankCountry, Description, Data, TestMode, Status, Token)¶

Checks payment availability for customer. Parameters must be sent as json object. Request data looks like:

{
      'AccountId': '1000', # Customer ID here
      'Amount': '10.00',
      'AuthCode': 'A1B2C3',
      'CardExpDate': '10/15',
      'CardFirstSix': '424242',
      'CardLastFour': '4242',
      'CardType': 'Visa',
      'Currency': 'RUB',
      'Data': '{"myProp":"myProp value"}',
      'DateTime': '2015-08-05 06:54:46',
      'Description': 'Payment description',
      'Email': '[email protected]',
      'InvoiceId': '1234567',
      'IpAddress': '46.251.83.16',
      'IpCity': 'Moscow',
      'IpCountry': 'RU',
      'IpDistrict': 'Moscow federal district',
      'IpLatitude': '56.329918',
      'IpLongitude': '44.009193',
      'IpRegion': 'Moscow district',
      'Name': 'CARDHOLDER NAME',
      'PaymentAmount': '10.00',  # Not found in documentation but exist in request
      'PaymentCurrency': 'RUB',  # No in docs
      'Status': 'Completed',
      'TestMode': '1',
      'Token': '477BBA133C182267FE5F086924ABDC5DB71F77BFC27F01F2843F2CDC69D89F05',
      'TransactionId': '1211506'
}
Parameters:
  • TransactionId (Int) – Mandatory - System transaction number.
  • Amount (Numeric) – Mandatory - Payment amount from widget. Dot as separator, two digits after dot.
  • Currency (String) – Mandatory - Currency: RUB/USD/EUR/GBP from widget parameters.
  • InvoiceId (String) – Not mandatory - Order number from widget parameters.
  • AccountId (String) – Mandatory - Customer identifier from widget parameters.
  • SubscriptionId (String) – Not mandatory - Subscription identifier from widget parameters (for recurrent payments).
  • Name (String) – Not mandatory - Card holder name.
  • Email (String) – Payer’s e-mail
  • DateTime – Mandatory - Payment creation date/time in UTC (yyyy-MM-dd HH:mm:ss).
  • IpAddress (String) – Not mandatory - Payer IP-address
  • IpCountry (String) – Not mandatory - Payer’s country double-chars code (according to ISO3166-1)
  • IpCity (String) – Not mandatory - Payer’s city
  • IpRegion (String) – Not mandatory - Payer’s region.
  • IpDistrict (String) – Not mandatory - Payer’s district.
  • CardFirstSix (String) – Mandatory - Credit card first 6 digits
  • CardLastFour (String) – Mandatory - Credit card last 6 digits
  • CardType (String) – Mandatory - Card payment system: Visa or MasterCard or Maestro
  • CardExpDate (String) – Mandatory - Card expiration date MM/YY
  • Issuer (String) – Not mandatory - Issuer bank name
  • IssuerBankCountry (String) – Not mandatory - Issuer bank country double-char code (according to ISO3166-1)
  • Description (String) – Not mandatory - Payment description from widget parameters.
  • Data (Json) – Not mandatory - Any json-data from widget.
  • TestMode (Bit) – Mandatory - Test mode flag (1 or 0)
  • Status (String) – Mandatory - Payment status: Completed — for single-step, Authorized — for double-step.
  • Token (String) – Not mandatory - Card token for recurrent payments without card data.
Return:

Status code, looks like {‘code’: 0}


CurrencyApi¶

POST /api/0/currency(code)bulliform

Add currency to list of available (NOT IMPLEMENTED)

Parameters:code (str) – Currency code
Returns:currencies (dict) – List of active currencies

Example:

{
    "currencies": [
        {
            "code": "RUB",
            "currency": "Russian rouble",
            "decimal": 2
        },
            "code": "USD",
            "currency": "United States dollar",
            "decimal": 2
        }
    ]
}

GET /api/0/currency(602) 266-9335

Returns list of currency

Returns:currency (list) – List of currency descriptions

Example:

{
    "currencies": [
        {
            "code": "RUB",
            "currency": "Russian rouble",
            "decimal": 2
        },
            "code": "USD",
            "currency": "United States dollar",
            "decimal": 2
        }
    ]
}

GET /api/0/currency/active¶

Return list of active currencies

Returns:currency_info (dict) – Dictionary with descriptions of active currencies

Example:

{
    "currencies": [
        {
            "code": "RUB",
            "currency": "Russian rouble",
            "decimal": 2
        },
            "code": "USD",
            "currency": "United States dollar",
            "decimal": 2
        }
    ]
}

DELETE /api/0/currency(code)collie

Remove currency from active list (NOT IMPLEMENTED)

Parameters:code (str) – Currency code
Returns:currencies (dict) – List of active currencies

Example:

{
    "currencies": [
        {
            "code": "RUB",
            "currency": "Russian rouble",
            "decimal": 2
        },
            "code": "USD",
            "currency": "United States dollar",
            "decimal": 2
        }
    ]
}

CustomerApi5797384505

GET /api/0/customer/<customer>/balance/history(customer, before, after, limit)¶

Return list of account changes.

Parameters:
  • customer (ID) – Customer ID.
  • before (Date) – Returns events which were happened before this date
  • after (Date) – Returns events which were happened after this date
  • limit (int) – Number of changes in the return list
Returns:

account_history (list) – List of changes


POST /api/0/customer/<customer>/payments/auto_withdraw(enabled, balance_limit, payment_amount)¶

Change auto withdraw balance limit and payment amount for specified customer

Parameters:
  • enabled (bool) – Enable or Disable auto withdraws
  • balance_limit (int) – Balance limit to proceed auto payment
  • payment_amount (int) – Payment amount
Return:

dict : Customer’s auto withdraw params.

Example:

{
    'enabled': True,
    'balance_limit': 100,
    'payment_amount': 500
}

GET /api/0/customer/<customer>/payments/auto_withdraw(customer)¶

Returns auto withdraw parameters for specified customer. :param Customer customer: Customer Id

Return:

dict : Customer’s auto withdraw params.

Example:

{
    'enabled': True,
    'balance_limit': 100,
    'payment_amount': 500
}

PUT /api/0/customer/<customer>/block(customer, blocked, message)¶

Block or unblock specific customer

Parameters:
  • customer (ID) – Customer ID.
  • blocked (bool) – Customer became block if it is true and unblock otherwise
  • message (str) – Admin’s message
Returns:

customer_info (Dict) – Customer info


DELETE /api/0/customer/<customer>/deferred(customer)¶

Cancel deferred changes for customer.

Parameters:customer (Id) – Customer Id
Return:None

PUT /api/0/customer/<customer>/quota(limits)¶

This method allows changing customer’s resources limits by user with role >=Manager

Parameters:limits (dict) – Dictionary with info about limits to update

Example:

{
    "maxImageMeta": 128,
    "maxTotalInstances": 1,
    ...
}
Returns:quota (dict) – Dict with info about quota

Example:

{"quota":
    [{"limit_id": maxImageMeta,
      "localization_description":
        {"en": "The maximum number of key-value pairs per image for the project.",
         "ru": "Максимальное количество пар ключ-значение в метаданных образа, всего на тенант."},
      "value": 128},
     {...}]

}

POST /api/0/customer/<customer>/quota(template)¶

Applies quota template to customer

Parameters:template – Template name in config
Returns:quota (list) – Dict with info about quota

Example:

{"quota":
    [{"limit_id": maxImageMeta,
      "localization_description":
        {"en": "The maximum number of key-value pairs per image for the project.",
         "ru": "Максимальное количество пар ключ-значение в метаданных образа, всего на тенант."},
      "value": 128},
     {...}]

}

POST /api/0/customer/<customer>/_fake_usage(customer, start, finish, service_id, resource_id, volume)¶

Add fake withdraw for test report generation

Parameters:
  • customer (Customer) – Customer Id
  • start (Date) – Start time of service usage
  • finish (Date) – Finish time of service usage
  • service_id (str) – Id of service (storage.disk, storage.volume, storage.image etc)
  • resource_id – name of used service. For example disk1, disk2
  • volume – Size of used resource. (Bytes for storage).
Return:

Int withdraw: Cost of fake withdraw


POST /api/0/customer/<customer>/deferred/force(customer)¶

Force to apply deferred changes for the customer. This method can be used only in tests!

Parameters:customer (Id) – Customer Id
Return:None

GET /api/0/customer/<customer>/tariff(customer)¶

Return tariff description for the customer

Parameters:customer (Id) – Customer Id
Returns:tariff_info (Dict) – Dict with tariff info

GET /api/0/customer/<customer>/deferred(customer)¶

Returns deferred changes for customer.

Parameters:customer (Id) – Customer Id
Returns:deferred (Dict) – Info about deferred changes

Example:

{
   {"deferred":
      {
        "user": {"user_id": 1, "name": "Super Admin"},
        "date": "2015-06-01T12:59:40+00:00",
        "comment": null,
        "tariff": {"description": "", "mutable": true,
                   "deleted": null, "parent_id": null, "default": null,
                   "tariff_id": 2,
                   "localized_name": {"ru": "xxxx", "en": "some name"},
                   "created": "2015-06-01T12:59:38+00:00"}}}
}

GET /api/0/customer/<customer>/history(before, after, limit, customer)¶

Returns customer profile history

Parameters:
  • before (Date) – Returns events which were happened before this date
  • after (Date) – Returns events which were happened after this date
  • limit (int) – Number of changes in the return list
  • customer (Customer) – Customer id
Returns:

history (List) – List of dict with history description

Note. Currently the following events are supported: “created”, “tariff”, “deleted”, “info”, “block”, “unblock”, “reset_email”, “reset_password”, “confirm_email”, “email_confirmed”, “make_prod”, “changed_quotas”, “change_password”

Example:

{"history": [{
    "user":
        {"name": "Super Admin", "user_id": 1},
    "snapshot": {
        "address": "",
        "withdraw_period": "month",
        "country": "",
        "customer_id": 1,
        "birthday": "1999-01-01",
        "city": "",
        "name": "test customer",
        "deleted": null,
        "customer_mode": "test",
        "customer_type": "private",
        "email_confirmed": false,
        "email": "[email protected]",
        "withdraw_date": "2015-07-01",
        "blocked": false,
        "tariff_id": 1,
        "telephone": "8(999)999 99 99",
        "currency": "rub",
        "balance_limit": 0,
        "os_user_id": null,
        "os_tenant_id": null,
        "subscription": {
            "status": {"enable": true, "email": ["[email protected]"]},
            "billing": {"enable": true, "email": ["[email protected]"]},
            "news": {"enable": true, "email": ["[email protected]"]}},
        "created": "2015-06-18T14:51:22+00:00"
    },
    "comment": null,
    "event": "tariff",
    "localized_name": {
        "en": "Customer's tariff was changed."
        "ru": "Тариф заказчика изменен."
    },
    "date": "2015-06-18T14:51:24+00:00"
},
{...}
]}

GET /api/0/customer/<customer>¶

Return customer info of current customer

Returns:customer_info (dict) –

Customer info.

Example:

{
    "customer_info": {
        "email": "[email protected]",
        "name": "John Doe",
        "deleted": null,
        "detailed_info": {
            "birthday": "1990-10-17",
            "country": "Russia",
            "city": "Moscow",
            "address": "Example street, 62",
            "telephone": "8 (909) 515-77-07"
        },
        "created": "2015-04-24T11:14:22",
        "withdraw_period": "month",
        "withdraw_date": "2015-07-01",
        "balance_limit": 0,
        "account": {"rub": {"balance": "1035.22", "current": "1035.22", "withdraw": "0.00"}},
        "os_tenant_id": 1,
        "os_user_id": 1,
        "promo_code": [{"value": "code_value_1"}, {"value": "code_value_2"}]
    }
}

PUT /api/0/customer/group(tariff, deferred_date, withdraw_period, comment, balance_limit, customer_type, locale)305-338-8400

Group update of customer profiles from admin panel. (allowed for admin and account director)

Parameters:
  • customers (List[Customer]) – Customer ids
  • tariff (Id) – New tariff id
  • deferred_date (Date) – Time when new tariff should applicable/
  • withdraw_period (str) – New withdraw period
  • comment (str) – Description why this changes were done
  • balance_limit (int) – New balance limit
  • customer_type (str) – New customer_type value, can be one from set (“private”, “entity”) [optional]
  • locale – Customer locale, it is used for report generating
Returns:

detailed_info (list) – List of customer info. Please see example in PUT /0/customer/me/


POST /api/0/customer/<customer>/invoice(customer, amount, currency, date, number)¶

Generate invoice for customer

Parameters:
  • customer (Id) – Customer Id
  • amount (Money) – Amount of invoice
  • currency (String) – Currency of invoice (not mandatory, by default current customer tariff currency is used)
  • date (Date) – Date of invoice (not mandatory, the current time is used by default)
  • number (int) – Order Id (not mandatry, the gap will be used by default)
Return:

PDF file


GET /api/0/customer(filter_text, email, name, birthday, country, city, address, telephone, tariff_ids, created_before, created_after, page, limit, visibility, blocked, customer_type, customer_mode, sort)avenolith

Return filtered customer list.

Parameters:
  • filter_text (str) – Filter customers by any field which contains filter_text
  • email (Email) – Customer email
  • name – Customer full name
  • birthday – Customer date of birth
  • country – Customer country
  • city – Customer city
  • address – Customer address
  • telephone – Customer telephone
  • tariff_ids – IDs’ list of customer’s tariff
  • created_before (date) – filters customers with creation date before this date
  • created_after (date) – filters customers with creation date after this date
  • page – page number
  • limit – number of customers per page
  • visibility (str) – Visibility options visible - Only active customers, [by default] deleted - Only removed customers. all - All customers.
  • blocked (bool) – Customer blocked or not
  • customer_type (str) – Customer type options private - private person entity - legal entity
  • customer_mode (str) – Customer mode options test - Customer in test period production - Production mode pending_prod - Customer going to production mode
  • sort (str) – List fields which is used for ordering
Returns:

customer_list (List) – List of customers for this query.

Example:

{
    "customer_list": {
        "per_page": 100,
        "total": 2,
        "page": 0
        "items": [
        {
            "account": {
                "USD": {
                    "balance": "10.00",
                    "withdraw": "0.00",
                    "current": "10.00"
                }
            },
            "detailed_info": {
                "name": "John Doe",
                "birthday": "1999-09-09",
                "country": "Russia",
                "city": "Moscow",
                "address": "Example street, 62",
                "telephone": "89876543212"
            },
            "created": "2013-09-19T06:42:03.747000+00:00",
            "deleted": null,
            "customer_id": "1",
            "email": "[email protected]",
            "withdraw_period": "month",
            "withdraw_date": "2015-07-01"
            "email_confirmed": false,
            "customer_mode": "test",
            "customer_type": "private",
            "tariff_id": 1,
            "blocked": false,
            "currency": "USD",
            "balance_limit": 0,
            "os_tenant_id": null,
            "os_user_id": null,
            "promo_code": []
        },
        {
            "detailed_info": {
                "name": Petr Company, LTD,
                "contract_number": "123456",
                "contract_date": "1970-01-01"
                "contact_person_name": "John Doe",
                "general_manager_name": "Petr Petrovich Petrov",
                "location_country": "Russia",
                "location_city": "Petrozavodsk",
                "location_address": "Example street, 63",
                "contact_telephone": "89123456789"
            },
            "created": "2013-09-19T06:42:03.747000+00:00",
            "deleted": null,
            "customer_id": "2",
            "email": "[email protected]",
            "withdraw_period": "month",
            "withdraw_date": "2015-07-01",
            "email_confirmed": true,
            "customer_mode": "production",
            "customer_type": "entity",
            "tariff_id": 2,
            "blocked": false,
            "currency": "USD",
            "balance_limit": 0,
            "os_tenant_id": 1,
            "os_user_id": 1,
            "promo_code": [{"value": "code_value_1"}, {"value": "code_value_2"}]
        }]}
}

OPTIONS /api/0/auth(575) 403-1965

POST /api/0/customer/<customer>/make_prod(customer, comment)¶

Set customer to production mode from admin panel.

Parameters:
  • customer (Customer) – Customer id
  • comment (Str) – Comment for changing customer to prod mode
Returns:

customer_info (dict) – Customer info.

Example:

{
    "customer_info": {
        {"customer_id": 1,
         "detailed_info": {
            "name": "John Doe",
            "birthday": "1990-10-17",
            "country": "Russia",
            "city": "Moscow",
            "address": "Example street, 62",
            "telephone": "8 (909) 515-77-07"
         },
         "deleted": null,
         "email": "[email protected]",
         "created": "2015-04-24T11:14:22",
         "blocked": false,
         "customer_mode": "test",
         "customer_type": "private",
         "withdraw_period": "month",
         "withdraw_date": "2015-07-01",
         "email_confirmed": true,
         "tariff_id": 2,
         "currency": "USD",
         "balance_limit": 0,
         "os_tenant_id": 1,
         "os_user_id": 1,
         "promo_code": [{"value": "code_value_1"}, {"value": "code_value_2"}],
         "account": {"rub": {"balance": "1035.22", "current": "1035.22", "withdraw": "0.00"}}
         }
    }
}

POST /api/0/customer(email, password, detailed_info, make_prod, customer_type, withdraw_period, promo_code, locale, bot_secret, g_recaptcha_response, timezone)¶

Registration of new customer.

Parameters:
  • email (Email) – Customer email
  • password (str) – Customer password
  • detailed_info (dict) – Dictionary with detailed customer’s info.
  • make_prod (bool) – Creates production customer. Available only from admin api
  • customer_type (str) – customer type: legal entity or private person(default). Available only from admin api
  • withdraw_period – Customer withdraw period. Available only from admin api
  • promo_code (str) – Promo code value for registration.
  • locale (str) – Customer locale, it is used for report generating
  • bot_secret (str) – Self signed string which allows to create new customer without recaptcha
  • g_recaptcha_response (str) – Response from recaptcha service
  • timezone (str) – Timezone name
Returns:

customer_info (dict) – Customer info.

Example:

{
    "customer_info": {
        {"customer_id": 1,
         "deleted": null,
         "email": "[email protected]",
         "detailed_info": {
            "name": "John Doe",
            "birthday": "1990-10-17",
            "country": "Russia",
            "city": "Moscow",
            "address": "Example street, 62",
            "telephone": "8 (909) 515-77-07"
         },
         "created": "2015-04-24T11:14:22",
         "blocked": false,
         "customer_mode": "test",
         "customer_type": "private",
         "withdraw_period": "month",
         "withdraw_date": "2015-07-01",
         "balance_limit": 0,
         "account": {
             "rub": {"balance": "1035.22", "current": "1035.22", "withdraw": "0.00"}
         },
         "os_tenant_id": 1,
         "os_user_id": 1,
         "os_dashboard": "horizon",
         "promo_code": [{"value": "code_value_1"}, {"value": "code_value_2"}]
         }
    }
}

OPTIONS /api/0/customer¶

GET /api/0/customer/<customer>/quota¶

Returns customer’s limits.

Returns:quota (list) – Dict with info about quota

Example:

{"quota":
    [{"limit_id": maxImageMeta,
      "localization_description":
        {"en": "The maximum number of key-value pairs per image for the project.",
         "ru": "Максимальное количество пар ключ-значение в метаданных образа, всего на тенант."},
      "value": 128},
     {...}]

}

POST /api/0/customer/<customer>/recreate_tenant(customer)¶

Recreate tenant in Open Stack for specified customer

Parameters:customer (Customer) – Customer Id
Return:None

DELETE /api/0/customer/<customer>(customer, comment)¶

Remove customer

Parameters:
  • customer (Id) – Customer Id
  • comment (str) – Description why customer is going to be removed
Return:

None


POST /api/0/customer/<customer>/report(customer, start, finish, report_format, report_type)¶

Asynchronous generate customer usage report for the period.

Parameters:
  • customer (Customer) – Customer Id
  • start (DateHour) – Start report period
  • finish (DateHour) – End report period
  • report_format (Str) – report format. Currently supported the following formats: json, csv, pdf, tsv
  • report_type (Str) – Type of report. Currently supported simple: simple, acceptance_act, detailed

This method returns report as is (content type is set depend on report format) when report is ready, or returns status of report task generation.

Example:

{
    "status": "in progress",
}

In the case when requested json report file, it is returned in report field.

Example:

{
    "status": "completed",
    "report": {
        "report_range": {
            "finish": "2015-05-01T00:00:00+00:00",
            "start": "2015-03-20T09:00:00+00:00",
        },
        "tariffs": [
            {
                "name": "Tariff for customers",
                "currency": "rub",
                "total_cost": "72.54",
                "usage": [
                    {
                        "measure": "Gb*month",
                        "name": "Volume",
                        "total_usage_volume": "998.00",
                        "total_cost": "4.03",
                        "price": "2.91",
                        "service_id": "storage.disk",
                        "category": "Storage"
                    },
                    {
                        "measure": "Gb*month",
                        "name": "Volume",
                        "total_usage_volume": "1996.00",
                        "total_cost": "34.21",
                        "price": "12.34",
                        "service_id": "storage.image",
                        "category": "Storage"
                    },
                    {
                        "measure": "Gb*month",
                        "name": "Volume",
                        "total_usage_volume": "1996.00",
                        "total_cost": "34.29",
                        "price": "12.37",
                        "service_id": "storage.volume",
                        "category": "Storage"
                    }
                ]
            }
        ],
        "total": {
            "rub": "72.54"
        },
        "customer": {
            "name": null,
            "email": "[email protected]",
            "locale": "ru_ru"
        }
    }
}

POST /api/0/customer/<customer>/restore(customer, comment, balance)¶

Restore removed customer

Parameters:
  • customer (Id) – Customer Id
  • comment (str) – Description why customer is going to be restored
  • balance (Money) – Initial balance
Return:

None


PUT /api/0/customer/<customer>/confirm_email¶

Send confirmation email to customer.

Return:None

PUT /api/0/customer/<customer>/deferred(customer, tariff, date, comment)¶

Update deferred changes for customer.

Parameters:
  • customer (Id) – Customer Id
  • tariff (Id) – New tariff ID
  • date (Date) – Date when tariff should be apply
  • comment (Str) – Comment why the tariff was changed
Returns:

deferred (Dict) – Info about deferred changes

Example:

{
   {"deferred":
      {
        "user": {"user_id": 1, "name": "Super Admin"},
        "date": "2015-06-01T12:59:40+00:00",
        "comment": null,
        "tariff": {"description": "", "mutable": true,
                   "deleted": null, "parent_id": null, "default": null,
                   "tariff_id": 2,
                   "localized_name": {"ru": "xxxx", "en": "some name"},
                   "created": "2015-06-01T12:59:38+00:00"}}}
}

GET /api/0/customer/<customer>/subscribe(customer)¶

Returns info about customer’s subscriptions to user

Parameters:customer (Id) – Customer Id
Returns:subscribe (Dict) – dict with info

Example:

{"subscribe":
    {
        "news": {"enable": False, "email": ["[email protected]", "[email protected]"]},
        "billing":  {"enable": False, "email": ["[email protected]", "[email protected]"]},
        "status": {"enable": True, "email": ["[email protected]"]}
    }
}

PUT /api/0/customer/<customer>/balance(customer, currency, amount, comment)¶

Manual balance change.

Parameters:
  • customer (ID) – Customer ID.
  • currency – Currency Id. Only active currencies are possible. By default current tariff currency is used
  • amount (str) – Money amount. The following format is allowed: “xxx.xx”. If the amount is positive, balance will be increased. Otherwise, the balance will be decreased
  • comment (str) – Comment for the balance changing
Returns:

customer_info (Dict) – Customer info


PUT /api/0/customer/<customer>(customer, password, email, detailed_info, tariff, comment, withdraw_period, balance_limit, customer_type, locale, os_dashboard, confirm_email)¶

Update customer profile from admin panel.

Parameters:
  • customer (Customer) – Customer id
  • password (str) – New password [optional]
  • email (str) – New email [optional]
  • detailed_info (dict) – Dictionary with detailed customer’s info [optional].
  • tariff (Id) – New tariff id
  • comment (str) – Description why this changes were done
  • withdraw_period (str) – New withdraw period
  • balance_limit (int) – New balance limit
  • customer_type (str) – New customer_type value, can be one from set (“private”, “entity”) [optional]
  • locale – Customer locale, it is used for report generating
  • os_dashboard – OpenStack dashboard selector. Available values: [‘horizon’, ‘skyline’, ‘both’]
  • confirm_email – mark customer email as confirmed if it is true
Returns:

detailed_info (dict) – Customer info. Please see example in PUT /0/customer/me/


PUT /api/0/customer/<customer>/subscribe(customer, subscribe)¶

Update customer’s subscriptions by user. Parameters must be sent as json object.

Parameters:
Returns:

subscribe (dict) – The same as subscribe argument


ExchangeApi¶

POST /api/0/customer/<customer>/service_subscription/<subscription>/exchange/box/add¶

Add email box

TODO

Example:

TODO


DELETE /api/0/customer/<customer>/service_subscription/<subscription>/exchange/box/<box>¶

Add email box

TODO

Example:

TODO


PUT /api/0/customer/<customer>/service_subscription/<subscription>/exchange/box/<box>¶

Add email box

TODO

Example:

TODO


undistinguished204-824-6117

NOTES: Graphit supports POST requests as well /github.com/graphite-project/graphite-web/issues/591

GET /api/0/graphite/metrics/find¶

POST /api/0/graphite/metrics/find¶

GET /api/0/graphite/render281-255-9905

POST /api/0/graphite/render¶

4106705397¶

POST /api/0/customer/<customer>/payments/invoice(customer, invoice_number, date, amount)¶

Add invoice for the customer

Parameters:
  • customer (Id) – Customer Id
  • invoice_number (str) – The invoice number
  • date (Day) – The date of the invoice
  • amount (Money) – The value of invoice
  • files (File[]) – The list of files
Return:

dict Invoice: Invoice description

Example:

{
  "invoice": {
    "date": "2016-08-29",
    "amount": "55.55",
    "files": {
      "invoice.pdf": "\/\/localhost:80\/api\/customer\/1\/payments\/invoice\/3\/invoice.pdf"
    },
    "invoice_id": 3,
    "state": "updating",
    "invoice_number": "21.11.16 #164"
  }
}

PUT /api/0/customer/<customer>/payments/invoice/<invoice>/complete(customer, invoice)¶

Complete invoice :param Id customer: Customer Id :param Id invoice: Invoice Id

Return:dict Invoice: Invoice description

DELETE /api/0/customer/<customer>/payments/invoice/<invoice>/<filename>(customer, invoice, filename)¶

Delete file

Parameters:
  • customer (Id) – Customer Id
  • invoice (Id) – The invoice id
  • filename (str) – File name
Return:

dict Invoice: Invoice description


GET /api/0/customer/<customer>/payments/invoice/<invoice>/<filename>(customer, invoice, filename)¶

Get attached to invoice file

Parameters:
  • customer (Id) – Customer Id
  • invoice (Id) – The invoice id
  • filename (str) – File name
Return:

File content


GET /api/0/customer/<customer>/payments/invoice(customer)¶

List invoices for customer

Parameters:customer (Id) – Customer Id
Return:dict Invoice: Invoice description

PUT /api/0/customer/<customer>/payments/invoice/<invoice>/invalid(customer, invoice)¶

Complete invoice :param Id customer: Customer Id :param Id invoice: Invoice Id

Return:dict Invoice: Invoice description

PUT /api/0/customer/<customer>/payments/invoice/<invoice>/paid(customer, invoice)¶

Mark the invoice as paid :param Id customer: Customer Id :param Id invoice: Invoice Id

Return:dict Invoice: Invoice description

PUT /api/0/customer/<customer>/payments/invoice/<invoice>(customer, invoice, invoice_number, date, amount)¶

Update invoice for the customer

Parameters:
  • customer (Id) – Customer Id
  • invoice (Id) – The invoice id
  • invoice_number (str) – The invoice number
  • date (Day) – The date of the invoice
  • amount (Money) – The value of invoice
  • files (File[]) – The list of files
Return:

dict Invoice: Invoice description


(612) 244-0619(703) 489-8343

POST /api/0/news(subject, body)5173059607

Creates news

Parameters:
  • subject – News’ subject
  • body – News’ body
Returns:

news_info (dict) – News’ info

Example:

{"news_info":
    {"news_id": 1,
     "subject": "test subject",
     "body": "test body",
     "deleted": None,
     "published": None
    }
}

DELETE /api/0/news/<news>(news)¶

Deletes news with specified id

Parameters:news – News’ id
Return:None

GET /api/0/news(subject, body, page, visible, published, limit, sort)(781) 992-9128

Returns news list

Parameters:
  • subject – news’ subject
  • body – news’ body
  • page – page number
  • visible – are deleted and not published news visible for user
  • published – filter by publishing date
  • limit – number of news per page
  • or List sort (str) – Field name or list of field names which is used for sorting. Ascending ordering is default. For descending ordering use “-” before.
Returns:

news_list (list) – list of news

Example:

{
    "news_list": {
        "per_page": 100,
        "total": 1,
        "limit": 200,
        "offset": 0
        "items": [
        {
            "news_id": 1,
            "subject": "test subject",
            "body": "test body",
            "deleted": None,
            "published": None
        }]
    }
}

POST /api/0/news/<news>(news, publish)¶

Publishes and unpublishes news with specified id

Parameters:
  • news – News’ id
  • publish (Bool) – what to do with news - publish or unpublish
Returns:

news_info (dict) – News’ info

Example:

{"news_info":
    {"news_id": 1,
     "subject": "test subject",
     "body": "test body",
     "deleted": None,
     "published": 2015-06-15T16:24:47
    }
}

PUT /api/0/news/<news>(news, subject, body)¶

Updates news with specified subject and body

Parameters:
  • news – News’ id
  • subject – subject to update
  • body – body to update
Returns:

news_info (dict) – News’ info

Example:

{"news_info":
    {"news_id": 1,
     "subject": "test subject",
     "body": "test body",
     "deleted": None,
     "published": None
    }
}

310-878-5514¶

POST /api/0/stat/customer¶

Returns customer statistics.

Example:

{
  "customer_stats": {
    "pending_prod_private": 0,
    "production": 2,
    "pending_prod_private_blocked": 0,
    "pending_prod": 0,
    "total": 5,
    "private_deleted": 1,
    "production_private_blocked": 0,
    "entity_deleted": 0,
    "total_test": 3,
    "pending_prod_entity_blocked": 0,
    "production_private": 2,
    "test_private_blocked": 1,
    "production_entity_blocked": 0,
    "test_entity_blocked": 0,
    "production_entity": 0,
    "test_private": 2,
    "test_entity": 1,
    "pending_prod_entity": 0,
    "total_blocked": 1,
    "total_deleted": 1
  }
}

POST /api/0/stat/openstack/usage(locale, force, report_format)¶

Asynchronous create an report that lists used resources by each customer. The data is provided by open stack

Parameters:
  • locale (Locale) – Locale for the report.
  • force (bool) – Force to retrieve latest data.
  • report_format (Str) – report format. Currently supported the following formats: csv, tsv, json

This method returns report as is (content type is set depend on report format) when report is ready, or returns status of report task generation.

Example:

{
    "status": "in progress",
}

POST /api/0/report/receipts(start, finish, locale, report_format)¶

Asynchronous create an report that lists all receipts of funds for all customers

Parameters:
  • start (DateHour) – Start report period
  • finish (DateHour) – End report period
  • locale (Locale) – Locale for the report
  • report_format (Str) – report format. Currently supported the following formats: csv, tsv

This method returns report as is (content type is set depend on report format) when report is ready, or returns status of report task generation.

Example:

{
    "status": "in progress",
}

GET /api/0/stat/ips¶

Returns IP address statistics.

Example:

{
    "floating_ips": {
         'active_customer': 4,
         'blocked_customer': 1,
         'customer_mode-production': 1,
         'customer_mode-test': 4,
         'customer_type-entity': 1,
         'customer_type-private': 4,
         'ip_status-DOWN': 3,
         'ip_status-UP': 2,
         'total': 5
    }
}

POST /api/0/report/usage(start, finish, locale, report_format)¶

Asynchronous create an report that lists used resources for all customers

Parameters:
  • start (DateHour) – Start report period
  • finish (DateHour) – End report period
  • locale (Locale) – Locale for the report
  • report_format (Str) – report format. Currently supported the following formats: csv, tsv

This method returns report as is (content type is set depend on report format) when report is ready, or returns status of report task generation.

Example:

{
    "status": "in progress",
}

ServiceApi¶

GET /api/0/service/<service_id>(service_id)¶

Return service description

Parameters:service_id (Id) – Service Id
Returns:service_info (dict) – Dict with service parameters

Example:

{
  "service_info": {
    "service_id": "storage.volume",
    "measure": {
      "measure_type": "time_quant",
      "measure_id": "gigabyte*month",
      "localized_name": {
        "ru": "Гб*месяц",
        "en": "Gb*month"
      }
    },
    "category": {
      "localized_name": {
        "ru": "Хранение данных",
        "en": "Storage"
      },
      "category_id": "storage"
    },
    "localized_name": {
      "ru": "Диск",
      "en": "Volume"
    }
  }
}

PUT /api/0/service/<service>/immutable(service)¶

Make service immutable.

Parameters:service (Id) – Service Id.
Returns:service_info (dict) – Dict as returned by GET /0/service/<service>/

GET /api/0/service(name, category, page, limit, visibility)¶

Return filtered list of services.

Parameters:
  • name (str) – Filter for service name
  • category (str) – Filter
  • page (int) – page number
  • limit (int) – number of items per page
  • visibility (str) – Visibility options visible - Only active services, [by default] deleted - Only removed services. all - All services.
Returns:

service_list (List) – List of services

Example:

{
    "service_list": {
        "total": 20,
        "per_page": 1,
        "page": 1,
        "items": [
            {
             "service_id":"net.associated_ip",
             "localized_name":{ 
                "ru":"net.associated_ip",
                "en":"net.associated_ip"
             },
             "measure":{
                "measure_id":"hour",
                "localized_name":{
                   "ru":"час",
                   "en":"hour"
                },
                "measure_type":"time"
             },
             "category":{
                "localized_name":{
                   "ru":"Сеть",
                   "en":"Network"
                },
                "category_id":"net"
             }
        ]
    }
}

GET /api/0/measure(measure_type)¶

Returns list of measures

Parameters:measure_type (String) – Return measures only specified type. It can be “time”, “quant” or ‘time_quant’
Returns:measure_list (list) – List of dict with measure info

Example:

{
    "measure_list": [
       {"measure_type": "time", "localized_name": {"ru": "час", "en": "hour"}, "measure_id": "hour"},
       {"measure_type": "time", "localized_name": {"ru": "месяц", "en": "month"}, "measure_id": "month"}
    ]
}

POST /api/0/service/custom(localized_name, description, measure)(940) 271-8876

Add new custom service.

Parameters must be sent as json object.

Parameters:
  • localized_name (LocalizedName) – Dict with name localization. en is mandatory key {"en": "Name", "ru": "Имя"}
  • description (LocalizedName) – Dict with localized description. (Not mandatory)
  • measure (Measure) – Measure id. Only time measure is possible.

Example:

{"service_info":
    {
        "mutable": true,
        "localized_name": {
            "ru": "",
            "en": "Test Custom Service"
        },
        "deleted": null,
        "measure": {
            "localized_name": {
                "ru": "час",
                "en": "hour"
            },
            "measure_type": "time",
            "measure_id": "hour"
        },
        "category": {
            'localized_name':
                {'ru': 'Дополнительные', 'en': 'Custom'},
                'category_id': 'custom'
            },
        "service_id": 1,
        "description": {}
    }
}

POST /api/0/service/vm(localized_name, description, flavor_id, vcpus, ram, disk, network)7276452706

Add new flavor service.

Parameters must be sent as json object.

Parameters:
  • localized_name (LocalizedName) – Dict with name localization. en is mandatory key {"en": "Name", "ru": "Имя"}
  • description (LocalizedName) – Dict with localized description. (Not mandatory)
  • flavor_id – Flavor name
  • vcpus – Number of flavor’s vcpus
  • ram – flavor’s RAM amount
  • disk – flavor’s disk size (Not mandatory)
  • network – flavor’s network (Not mandatory)

Example:

{"service_info":
    {
        "mutable": true,
        "localized_name": {
            "ru": "Флавор TestFlavor",
            "en": "Flavor TestFlavor"
        },
        "deleted": null,
        "measure": {
            "localized_name": {
                "ru": "час",
                "en": "hour"
            },
            "measure_type": "time",
            "measure_id": "hour"
        },
        "category": {
            "localized_name": {
                "ru": "Виртуальные машины",
                "en": "Virtual server"
            },
            "category_id": "vm"
        },
        "service_id": 1,
        "description": {}
    }
}

DELETE /api/0/service/<service>(service)¶

Archive service (only custom services can be deleted)

Parameters:service (Id) – Service Id
Return:None

GET /api/0/category352-518-8687

Returns list of categories with localized names

Returns:category_list (list) – List of dict with category

Example:

{"category_list": [
   {"category_id": "net", "localized_name": {"ru": "Сеть", "en": "Network"}},
   {"category_id": "storage", "localized_name": {"ru": "Хранение данных", "en": "Storage"}},
   {"category_id": "vm", "localized_name": {"ru": "Виртуальные машины", "en": "Virtual machine"}},
   {"category_id": "custom", "localized_name": {"ru": "Дополнительные", "en": "Custom"}}]}

PUT /api/0/service/<service>/custom(service, localized_name, description, measure)¶

Update custom service. (only custom services can be updated)

Parameters must be sent as json object.

Parameters:
  • service (Id) – Service Id
  • localized_name (LocalizedName) – Dict with name localization. en is mandatory key {"en": "Name", "ru": "Имя"}
  • description (LocalizedName) – Dict with localized description.
  • measure (Measure) – Measure id. Only time measure is possible.
Returns:

service_info (dict) – Dict as returned by GET /0/service/<service>/


PUT /api/0/service/<service>/vm(service, localized_name, description, flavor_id, vcpus, ram, disk, network)¶

Update Flavor.

Parameters must be sent as json object.

Parameters:
  • service (ServiceId) – Service Id
  • localized_name (LocalizedName) – Dict with name localization. en is mandatory key {"en": "Name", "ru": "Имя"}
  • description (LocalizedName) – Dict with localized description.
  • flavor_id – Flavor name
  • vcpus – Number of flavor’s vcpus
  • ram – flavor’s RAM amount
  • disk – flavor’s disk size
  • network – flavor’s network
Returns:

service_info (dict) – Dict as returned by GET /0/service/<service>/


ServiceSubscriptionApiPipilo

POST /api/0/customer/<customer>/service_subscription(customer, service, name, values)¶

Create new subscription for the customer

Parameters:
  • customer (Id) – Customer Id
  • service (Id) – Id of third party service
  • name (str) – Name of subscription
  • values (Dict) – Dict with values of services
Return:

subscription: Subscription description

Example:

{"subscription":
   {"deleted": null,
    "subscription_id": 1,
    "services":
       {"servicenow.support-24-7":
             {"localized_name": {"ru": "24*7",
                                 "en": "24*7"},
              "measure": "month",
              "value": null},

       "servicenow.approver":
             {"localized_name": {"ru": "Approver",
                                 "en": "Service Now Full Approver licence"},
              "measure": "licence*month",
              "value": null},
     "state": "requested",
     "customer_id": 1,
     "created": "2016-08-02T13:30:38+00:00",
     "name": "Test ServiceNow name"}}

DELETE /api/0/customer/<customer>/service_subscription/<subscription>(customer, subscription)¶

Delete subscription

Parameters:
  • customer (Id) – Customer Id
  • subscription (Id) – Subscription Id
Return:

subscription: Subscription description

Example:

{"subscription":
   {"deleted": null,
    "subscription_id": 1,
    "services":
       {"servicenow.support-24-7":
             {"localized_name": {"ru": "24*7",
                                 "en": "24*7"},
              "measure": "month",
              "value": null},

       "servicenow.approver":
             {"localized_name": {"ru": "Approver",
                                 "en": "Service Now Full Approver licence"},
              "measure": "licence*month",
              "value": null},
     "state": "requested",
     "customer_id": 1,
     "created": "2016-08-02T13:30:38+00:00",
     "name": "Test ServiceNow name"}}

GET /api/0/service_subscription/<service_id>(service_id)¶

Return service description

Parameters:service_id (Id) – Service Id
Returns:service_info (dict) – Dict with service parameters

Example:

{"service_info":
   {"sub":
        {"servicenow.fullfiller":
              {"localized_name": {"ru": "Service Now Full filler ",
                                  "en": "Service Now Full filler licence"},
               "measure": "licence*month", "value": [5, 10, 15, 25, 50, 100, 500]},
         "servicenow.approver":
              {"localized_name": {"ru": "Service Now Full Approver ",
                                  "en": "Service Now Full Approver licence"},
         "measure": "licence*month", "value": [5, 10, 15, 25, 50, 100, 500]},
    "service_id": "servicenow",
    "localized_name": {"ru": "Service Now", "en": "Service Now"},
    "states": ["requested", "active", "rejected", "deleted"]}
}

GET /api/0/customer/<customer>/service_subscription/<subscription>(customer, subscription)¶

Get customer subscription

Parameters:
  • customer (Id) – Customer Id
  • subscription (Id) – Subscription Id
Return:

subscription: Subscription description


GET /api/0/service_subscription(name)¶

Return filtered list of services.

Parameters:name (str) – Filter for service name
Returns:service_list (List) – List of services

Example:

{
    "service_list": [
        {
            "localized_name": {
                "ru": "Naumen",
                "en": "Naumen"
            },
            "category_id": "naumen"
        },
        {
            "localized_name": {
                "ru": "Service Now",
                "en": "Service Now"
            },
            "category_id": "servicenow"
        }
    ]
}

GET /api/0/customer/<customer>/service_subscription(customer, name, deleted, service, state)¶

Get filtered list of subscription for the customer

Parameters:
  • customer (Id) – Customer Id
  • name (str) – Name of subscription (not mandatory)
  • deleted (Bool) – Only not deleted records will be returned if this parameter is not set and only deleted will be returned if it is True, otherwise all records will be returned.
  • service (str) – Name of service (not mandatory)
  • state (str) – State of subscription (not mandatory)
Return:

subscriptions: Subscription description

Example:

{"subscriptions":
   [
      {"deleted": null,
       "name": "Test ServiceNow new name service",
       "state": "requested",
       "customer_id": 1,
       "subscription_id": 1,
       "created": "2016-08-02T13:54:48+00:00",
       "services":
           {"servicenow.support-24-7":
                {"localized_name": {"ru": "Service Now 24*7",
                                    "en": "Service Now Support 24*7"},
                 "measure": "month",
                 "value": null}
           }
       }
   ]}

PUT /api/0/customer/<customer>/service_subscription/<subscription>(customer, subscription, name, state, values)¶

Update subscription for the customer

Parameters:
  • customer (Id) – Customer Id
  • subscription (Id) – Subscription Id
  • name (str) – Name of subscription (not mandatory)
  • state (str) – State of subscription (not mandatory)
  • values (Dict) – Dict with values of services (not mandatory)
Return:

subscription: Subscription description

Example:

{"subscription":
   {"deleted": null,
    "subscription_id": 1,
    "services":
       {"servicenow.support-24-7":
             {"localized_name": {"ru": "24*7",
                                 "en": "24*7"},
              "measure": "month",
              "value": null},

       "servicenow.approver":
             {"localized_name": {"ru": "Approver",
                                 "en": "Service Now Full Approver licence"},
              "measure": "licence*month",
              "value": null},
     "state": "requested",
     "customer_id": 1,
     "created": "2016-08-02T13:30:38+00:00",
     "name": "Test ServiceNow name"}}

(541) 899-42733026127216

DELETE /api/0/tariff/<tariff>(tariff)¶

Move the tariff to archive.

Note

Only unused tariffs can be archived.

Parameters:tariff (Id) – Tariff ID.
Return:Empty object

GET /api/0/tariff(name, description, currency, parent, visibility, page, limit, show_used, sort)¶

Returns paginated filtered tariff list.

Parameters:
  • name (str) – Match tariff name
  • description (str) – Match tariff description
  • currency (str) – Match by currency
  • parent (TariffId) –

    Match by parent tariff

    The following values are possible:

    • Valid tariff id: Returns list of children tariffs;
    • 0: Returns list of tariffs without parents.
  • visibility (str) –

    The following values are possible: - visible: returns all not archived tariffs - deleted: returns only archived tariffs - all: returns all tariffs

    By default “visible” is used

  • page (int) – Page
  • limit (int) – Numbers of items per page.
  • show_used (bool) – include field “used” in the reply which means how many customers are assigned to this tariff
  • or List sort (str) – Sorting field name. Ascending ordering is default. For descending ordering use “-” before.
Returns:

tariff_list (list) – List of tariff info dictionaries (dict as in GET /0/tariff/<tariff>/)

Example:

{
    "tariff_list": {
       "items": [
            {
                ...
            },
            {
                ...
            }
       ]
       "total": 2,
       "limit": 200,
       "offset": 0
    }
}

GET /api/0/tariff/<tariff>(tariff)¶

Returns tariff info

Parameters:tariff (ID) – Tariff ID
Returns:tariff_info (dict) – Returns dict with tariff description.

Example:

  "tariff_info": {
    "services": [
      {
        "price": "12.23",
        "default": false,
        "service": {
          "service_id": "m1.small",
          "category": {
            "category_id": "vm",
            "localized_name": {
              "ru": "Виртуальные машины",
              "en": "Virtual machine"
            }
          },
          "measure": {
            "localized_name": {
              "ru": "час",
              "en": "hour"
            },
            "measure_id": "hour",
            "measure_type": "time"
          },
          "localized_name": {
            "en": "m1.small",
            "ru": "m1.small"
          }
        }
      },
      {
        "price": "23.45",
        "service": {
          "service_id": "m1.medium",
          "category": {
            "category_id": "vm",
            "localized_name": {
              "ru": "Виртуальные машины",
              "en": "Virtual machine"
            }
          },
          "measure": {
            "localized_name": {
              "ru": "час",
              "en": "hour"
            },
            "measure_id": "hour",
            "measure_type": "time"
          },
          "localized_name": {
            "en": "m1.medium",
            "ru": "m1.medium"
          }
        }
      }
    ],
    "deleted": null,
    "parent_id": null,
    "localized_name": {
      "en": "Tariff Begin",
      "ru": "Тарифф Бегин"
    },
    "created": "2015-05-26T18:09:02+00:00",
    "description": "Жутко дорогой тарифф",
    "tariff_id": 1,
    "mutable": true,
    "currency": "rub"
  }
}

GET /api/0/tariff/<tariff>/history/<history>(tariff)¶

Returns list of changes for tariff

Parameters:tariff (ID) – Tariff ID
Returns:tariff_history_list (List) – Changes list for the tariff

GET /api/0/tariff/<tariff>/history(tariff, date_before, date_after)¶

Returns list of changes for tariff

Parameters:
  • tariff (ID) – Tariff ID
  • date_before (Date) – Returns events which were happened before this date
  • date_after (Date) – Returns events which were happened after this date
Returns:

tariff_history_list (List) – tariff operations list.


GET /api/0/tariff/default7195805757

Get description of default tariff

Returns:tariff_info (dict) – Returns dict with tariff description.

PUT /api/0/tariff/<tariff>/immutable(tariff)¶

Update tariff.

Parameters:tariff (Id) – Tariff Id.
Returns:tariff_info (dict) – Dict as returned by GET /0/tariff/<tariff>/

PUT /api/0/tariff/<tariff>/default(tariff)¶

Make tariff default

Parameters:tariff (ID) – Tariff ID
Returns:tariff_info (dict) – Returns dict with tariff description.

POST /api/0/tariff(localized_name, description, currency, parent_id, services)¶

Create new tariff.

Parameters must be sent as json object.

Parameters:
  • localized_name (LocalizedName) – Dict with name localization. en is mandatory key {"en": "Name", "ru": "Имя"}
  • description (str) – Tariff description
  • currency (str) – Currency code
  • parent_id (TariffId) – Parent tariff id
  • services (list) –

    List services and its prices

    Example of list:

        services: [
            {
                "service_id": "m1.small",
                "price": "12.23"
            },
            {
                "service_id": "m1.medium",
                "price": "21.32"
            }
        ]
    }
    
Returns:

tariff_info (dict) – Dict as returned by GET /0/tariff/<tariff>/


PUT /api/0/tariff/<tariff>(tariff, localized_name, description, currency, services)¶

Update tariff.

Parameters must be sent as json object.

Parameters:
  • tariff (Id) – Tariff Id.
  • localized_name (LocalizedName) – Dict with name localization. en is mandatory key {"en": "Name", "ru": "Имя"}
  • description (str) – Tariff description.
  • currency (str) – Currency.
  • services (list) – List services and its prices
Returns:

tariff_info (dict) – Dict as returned by GET /0/tariff/<tariff>/


UserApi8184072375

GET /api/0/user/me¶

Return user info of current user.

Returns:user_info (dict) – User info

Example:

{
    "user_info": {
        {"name": "Super Admin",
         "deleted": null,
         "email": "[email protected]",
         "role": {'localized_name': {'en': 'Administrator', 'ru': 'Администратор'},
                  'role_id': 'admin'}
         "created": "2015-04-24T11:14:22"}
    }
}

GET /api/0/user/<user_id>(user_id)¶

returns user info

Parameters:user_id (user) – user id
Returns:user_info (dict) – the dict has the same structure as result of method get /0/user/me/

GET /api/0/user(email, role, role_list, visibility, deleted_before, deleted_after, created_before, created_after, page, limit, visibility, sort)¶

Return filtered user list.

Parameters:
  • email (str) – Mask for email
  • role (Role) – Role - user role
  • role_list (List) – user role list
  • visibility (str) – Visibility options visible - Only active users, [by default] deleted - Only removed users. all - All users.
  • deleted_before (Date) – 401-599-4429 - Filter users which were archived before this date.
  • deleted_after (Date) – Date - Filter users which were archived after this date.
  • created_before (Date) – Date - Filter users which were created before this date.
  • created_after (Date) – Date - Filter users which were created after this date.
  • page (int) – Page
  • limit (int) – Number of elements per page
  • visibility – Visibility options visible - Only active customers, [by default] deleted - Only removed customers. all - All customers.
  • or List sort (str) – Field name or list of field names which is used for sorting. Ascending sort is default. For descending sort use “-” before name. Default sorting field: (‘email’);
Returns:

user_list (List) – List of users for this query.

Example:

{
    "user_list": {
        "total": 2,
        "limit": 200,
        "offset": 0
        "items": [
        {
            "name": null,
            "created": "2013-09-19T06:42:03.747000+00:00",
            "deleted": null,
            "role": {'localized_name': {'en': 'Administrator', 'ru': 'Администратор'},
                     'role_id': 'admin'}
            "user_id": "523a9cbb312f9120c41b96b5",
            "email": "[email protected]"
        },
        {
            "name": null,
            "created": "2013-09-19T06:42:03.823000+00:00",
            "deleted": null,
            "role": {'localized_name': {'en': 'Administrator', 'ru': 'Администратор'},
                     'role_id': 'admin'}
            "user_id": "523a9cbb312f9120c41b96b6",
            "email": "[email protected]"
        }]}
}

POST /api/0/auth(email, password, return_user_info)¶

Auth user by email and password. This method setup cookie which can be used in next requests.

Parameters:
  • email (Email) – User 8887221129.
  • password (str) – User password (flat text).
  • return_user_info (Bool) – Return user info of logged user.
Returns:

user_info (dict) – User info

Example:

{
    "user_info": {
        {"name": "Super Admin",
         "deleted": null,
         "email": "[email protected]",
         "role": {'localized_name': {'en': 'Administrator', 'ru': 'Администратор'},
                  'role_id': 'admin'}
         "created": "2015-04-24T11:14:22"}
    }
}

POST /api/0/logout¶

Stop user session.


POST /api/0/user(email, password, role, name)¶

Registration of new user.

Parameters:
  • email (Email) – User email (8007634563);
  • password (str) – User Password. If the it is empty then the password recovery email will be sent to the email.
  • role (str) – User role.
  • name (str) – User display name [optional]
Returns:

user_info (dict) – User info.

Example:

{
    "user_info": {
        {"name": "Super Admin",
         "deleted": null,
         "email": "[email protected]",
         "role": {'localized_name': {'en': 'Administrator', 'ru': 'Администратор'},
                  'role_id': 'admin'}
         "created": "2015-04-24T11:14:22"}
    }
}

POST /api/0/user/password_reset/<password_token>(password_token, password)¶

Reset user password

Parameters:
  • password_token (PasswordResetToken) – Token which was returned by method POST /0/user/request_password_reset/;
  • password (str) – New password.
Return:

None


DELETE /api/0/user/me¶

Mark myself user as removed

Return:None

DELETE /api/0/user/<user>¶

Mark user as removed

Param:None

DELETE /api/0/user/password_reset(email)¶

Sent email with link to reset password

Parameters:email (Email) – Email - user email
Return:None.

PUT /api/0/user/me(password, name, email)¶

Update user self profile.

Parameters:
  • password (str) – New password [optional]
  • name (str) – New name [optional]
  • email (str) – New email [optional]
Returns:

user_info (dict) – User info


PUT /api/0/user/<user>(user, password, name, email)¶

Update user profile of other user.

Parameters:
  • user (User) – User id
  • password (str) – New password [optional]
  • name (str) – New name [optional]
  • email (str) – New email [optional]
Returns:

user_info (dict) – Dict with user info, as in PUT /0/user/me/


GET /api/0/user/password_reset/<password_token>(password_token)¶

Checks that password reset token is valid.

Parameters:password_token (PasswordResetToken) – Token which was returned by method POST /0/user/request_password_reset/.
Return:None.

UtilityApi¶

GET /api/0/event/<event>/allowed_period(event)¶

Returns list of allowed periods for events.

Parameters:event (str) – Type of event. Currently supported: auto_report
Returns:periods (List) – List of periods.

Example:

{
  "periods": [
                {'period_id': 'week', 'localized_name': {'ru': 'еженедельно', 'en': 'weekly'}},
                {'period_id': 'month', 'localized_name': {'ru': 'ежемесячно', 'en': 'monthly'}},
                {'period_id': 'quarter', 'localized_name': {'ru': 'ежеквартально', 'en': 'quarterly'}}
             ]
}

GET /api/check_exception860-398-4906

Service method, it raise exception to be sure that sentry and log system is configured as expected


GET /api/0/country¶

Return list of countries with internationalization

return List countries:
 list of countries with internationalization

Example:

{"countries":
    [{"code": "BN", "localized_name": {"en": "Brunei Darussalam", ru: "Бруней-Даруссалам"}},
     {"code": "AN", "localized_name": {"en": "Netherlands Antilles",
                                       "ru": "Нидерландские Антильские острова"}}]
}

GET /api/favicon.ico¶

DELETE /api/0/_force_delete(field, prefix)(281) 231-5585

Service method. It removes objects from db. Only tests should use it!

Parameters:
  • tables (Table[]) – List of tables for cleanup
  • field (Field) – This field is used for filtering. For example name or email. By default the unique index of table is used
  • prefix (str) – Prefix for object removing

GET /api/0/language/active8137300197

Return list of active languages

Returns:language_list – List of languages.

Example:

{
    "language_list": {
        "ru": {
            "ru": "Русский",
            "en": "Russian"
        },
        "en": {
            "ru": "Английский",
            "en": "English"
        }
    }
}

GET /api/0/locale/active6397994990

Returns list of active locales.

Returns:locale_list (List) – List of locales.

Example:

{
    "locale_list": {
        "ru": {
            "ru": "Русский",
            "en": "Russian"
        },
        "en": {
            "ru": "Английский",
            "en": "English"
        },
        "en_CA": {
            "ru": "Канадский...",
            "en": "Canadian English"
        },
        "en_AU": {
            "ru": "Австралийский ...",
            "en": "Australian English"
        },
        "en_US": {
            "ru": "Американский...",
            "en": "U.S. English"
        },
        "en_GB": {
            "ru": "Британский...",
            "en": "British English"
        }
    }
}

GET /api/config.js208-206-7739

Return config for frontend

Example:

window.CONFIG = {
   "default_language": "en",
   "show_region_info": true,
   "sentry": "/fabb17faa23840a78f84b1a6800678ec:[email protected]/2",
   "region": "dev",
   "google_analytics":
       {"admin": "UA-62743660-2", "lk": "UA-62743660-1"},
   "availability_zone": "local",
   "provider_info":
       {"support_email": "[email protected]", "site_url": "hosting.com",
        "support_phone": "+7 499 765-55-55"},
   "support_subjects": ["Финансовые вопросы", "Технические вопросы"],
   "recaptcha_site_key": "6LdBgwgTAAAAAIf7gim356DhVC6TlaV-Yg3xkPGc",
   "horizon_url": "/boss.ru/horizon",
   "version": "0.1.1"
   }

GET /api/0/language248-770-3054

Return list of all languages

Returns:language_list – List of languages.

Example:

{
    "language_list": {
        "ru": {
            "ru": "Русский",
            "en": "Russian"
        },
        "en": {
            "ru": "Английский",
            "en": "English"
        },
        "gv": {
            "ru": "Мэнский",
            "en": "Manx"
        },
        ...
    }
}

GET /api/0/timezone972-422-2890

List available timezones

Return:all: List all available timezones
Return:current: List all available timezones for customer’s country

Example:

{
    "timezones": [
        {
            "offset_human": "00:00",
            "name": "Africa/Abidjan",
            "dst": 0,
            "offset_minutes": 0,
            "tzname": "GMT"
        },
        {
            "offset_human": "03:00",
            "name": "Europe/Moscow",
            "dst": 0,
            "offset_minutes": 180,
            "tzname": "MSK"
        },

    ...
}

GET /api/versionmoll

Returns current code version

Returns:
  • version (str) – Release version
  • region (str) – backend region
  • availability_zone (str) – backend availability_zone
  • api_version (str) –

    supported api version

    Example:

    {
        region: "az1",
        version: {
            date: "2013-10-15_20-52-33",
            release: "dev",
            build: 509
        },
        stage: "dev"
    }
    

OPTION /api/config.js¶

GET /api/0/quotas/templates¶

Get description of quotas templates

Returns:quotas_templates (list) – Returns list of dicts with all quotas templates information.

Example:

{
    "quotas_templates": [
        {
            "template_id": "test_customer",
            "template_info": [{
                "limit_id": "fixed_ips",
                "localized_description": {
                    "en": "The maximum number of fixed IPs (private IPs) for the project.",
                    "ru": "Максимальное количество внутренних IP адресов (fixed_ip), всего на тенант."
                },
                "localized_name": {
                    "en": "Private IPs",
                    "ru": "Внетренние IP"
                },
                "localized_measure": {
                    "en": "pcs.",
                    "ru": "шт."
                },
                "value": 128
            }, {...}]
        },
        {...}
    ]
}

GET /api/0/role437-403-8786

Returns list of roles with internalization

Example:

{"roles":
    [{"role_id": "manager", "localized_name": {"ru": "Менеджер", "en": "Manager"}},
     {"role_id": "support", "localized_name": {"ru": "Поддежрка", "en": "Support"}},
     {"role_id": "account", "localized_name": {"ru": "Бизнес Менеджер", "en": "Business Manager"}},
     {"role_id": "admin",   "localized_name": {"ru": "Админ", "en": "Admin"}}}
}

POST /api/0/send_email(send_to, send_cc, subject)¶

Send email to specified email send_to with custom subject and body.

Parameters:
  • send_to (Email) – email to send message to.
  • send_cc (list) – list of emails for cc email field.
  • subject (str) – custom subject for email.

GET /api/0/health¶

Checks health of services: db, redis, openstack

Returns:health (dict) – dict with services states

Example:

{
    "health": {
        "db_write": true,
        "db_read": false,
        "redis_read": true,
        "redis_write": false,
        "openstack_api": true
    }
}

GET /api/0/subscription¶

Return list of subscriptions with internationalization

return List subscriptions:
 list of subscriptions with internationalization

Example:

{"subscriptions":
    [{"name": "news",
        "localized_description":
            {"en": "Subscribe to announcements of special offers, new tariffs and services.",
             "ru": "Рассылка анонсов о спецакциях, новых тарифах и услугах компании."}
     {"name": "billing",
        "localized_description":
            {"en": "Notifications on cash flow on your account (debiting and replenishment).",
             "ru": "Рассылка уведомлений об угрозе блокирования аккаунта, о блокировке и разблокировке."}}]
}

GET /api/0/test_post(a=None, b=None, c=None)309-999-0077

POST /api/0/test_post(a=None, b=None, c=None)¶

YandexMoneyPaymentsApi¶

POST /api/0/payments/yandexmoney/check¶

Check that payment is acceptable from yandex money

Return:Status code, looks like {‘code’: 0}

POST /api/0/payments/yandexmoney/pay¶

Process payment from yandex money

Return:Status code, looks like {‘code’: 0}

POST /api/0/payments/yandexmoney/post_pay9703859762

Process customer payments from yandex money

Return:Status code, looks like {‘code’: 0}

2896507950(819) 372-1797

(801) 573-7508(440) 853-4959

GET /lk_api/0/customer/me/backup/schedule3238033247

Return list of configured backup schedule :return dict backup_schedule_list: List of schedules


DELETE /lk_api/0/customer/me/backup/schedule(volume_id)¶

Delete schedule for the specific volume

Parameters:volume_id (str) – Id of volume

:return empty


POST /lk_api/0/customer/me/backup/schedule(volume_id, cron, count)Milvago

Create or update schedule for the specific volume

Parameters:
  • volume_id (str) – Id of volume
  • cron (str) – Schedule string in cron format
  • count (int) – Number of snapshots which will be stored.
Returns:

backup_schedule (dict) – Description of schedule


CustomerApi¶

GET /lk_api/0/customer/me/balance/history(before, after, limit)¶

Return list of account changes.

Parameters:
  • before (Date) – Returns events which were happened before this date
  • after (Date) – Returns events which were happened after this date
  • limit (int) – Number of changes in the return list
Returns:

account_history (list) – List of changes


POST /lk_api/0/customer/me/payments/auto_withdraw(enabled, balance_limit, payment_amount)5876744191

Change auto withdraw balance limit and payment amount.

Parameters:
  • enabled (bool) – Enable or Disable auto withdraws
  • balance_limit (int) – Balance limit to proceed auto payment
  • payment_amount (int) – Payment amount
Return:

dict : Customer’s auto withdraw params.

Example:

{
    'enabled': True,
    'balance_limit': 100,
    'payment_amount': 500
}

GET /lk_api/0/customer/me/payments/auto_withdraw905-691-6231

Returns auto withdraw parameters.

Example:

{
    'enabled': True,
    'balance_limit': 100,
    'payment_amount': 500
}

DELETE /lk_api/0/customer/payments/cloudpayments/card(card_id)¶

Delete specified card from customer’s payment cards.

Parameters:card_id (int) – Customer’s card identifier
Return:dict : Empty dictionary.

Example:

{}

POST /lk_api/0/customer/confirm_email/<confirm_token>(confirm_token)¶

Confirm customer email

Parameters:confirm_token (String) – Token which was returned by method PUT /0/customer/confirm_email/;
Returns:password_token – If customer password is not set this field contains password_reset token

GET /lk_api/0/customer/payments/cloudpayments/card(848) 235-8562

Return customer’s payment cards :return dict cards: Contains list of dicts with info about customer’s cards.

Example:

{'cards': [
    {
        'card_id': 1,
        'card_type': 'Visa',
        'last_four': '4242',
        'status': 'active'
    }
]}

GET /lk_api/0/customer/me/os_login580-356-6555

Method is checking if cookies is valid. If not, set up new cookies required to login in horizon


GET /lk_api/0/customer/me(304) 555-2951

Return customer info of current customer

Returns:customer_info (dict) –

Customer info.

Example:

{
    "customer_info": {
        {"name": "John Doe",
         "blocked": false,
         "email": "[email protected]",
         "birthday": "1990-10-17",
         "country": "Russia",
         "city": "Moscow",
         "address": "Example street, 62",
         "telephone": "8 (909) 515-77-07",
         "created": "2015-04-24T11:14:22",
         "withdraw_period": "month",
         "withdraw_date": "2015-07-01"
         "balance_limit": 0,
         "account": {
             "rub": {"balance": "1035.22", "current": "1035.22", "withdraw": "0.00"}
         },
         "tariff_id": 1,
         "currency": "rub",
         "os_tenant_id": 1,
         "os_user_id": 1,
         "promo_code": [{"value": "code_value_1"}, {"value": "code_value_2"}]
         }
        }
    }
}

Note: Each customer can have several accounts. Account is created for each used currency. Account contains two ‘subaccount’. Balance is like classic bank account. You can put money to it and money can be charged from it. ‘Withdraw’ means how many resources were used in current payment period (month by default) In the end of payment period ‘withdraw’ is charged from ‘balance’. ‘Current’ is ‘Balance’ - ‘Withdraw’


GET /lk_api/0/customer/me/os_token¶

Return customers token info for OpenStack authorization.

Example:

{
    'metadata': {
        'is_admin': 0,
        'roles': ['abcabcabc']
    },
    'serviceCatalog': [...],
    'token': {
        'audit_ids': ['aaaaa'],
        'expires': '2015-11-13T13:15:34Z',
        'id': 'abcabcabc',
        'issued_at': '2015-11-13T12:15:34.900950',
        'tenant': {
            'description': '...',
            'enabled': True,
            'id': 'abcabcabc',
            'name': '...'
        }
    },
    'user': {
        'id': 'abcabcabc',
        'name': '...',
        'roles': [{'name': '_member_'}],
        'roles_links': [],
        'username': 'abcabcabc'
    },
    'version': 'v2.0'
}

GET /lk_api/0/customer/me/tariff¶

Return tariff description for the customer

Returns:tariff_info (Dict) – Dict with tariff info

GET /lk_api/0/customer/me/used_quotas(force)¶

Returns info about used resources in os.

Parameters:force – Force update the used quota for the customer. I.e. it run async task to update. New value will be available on next requests only.
Return:dict used_quotas: Dict with info about used quotas
Return:bool loading: true when quota cache is empty. Async request to openstack is processed
Return:int ago: how many seconds ago used quoata was refreshed

Example:

{
  "used_quotas": {
    "storage_group": {
      "quotas": [
        {
          "localized_description": {
            "en": "Maximum number of volumes per tenant.",
          },
          "limit_id": "volumes",
          "localized_measure": {
            "en": "pcs.",
            "ru": "шт."
          },
          "max_value": 10,
          "value": null,
          "localized_name": {
            "en": "Volumes",
            "ru": "Диски"
          }
        }
      ],
      "localized_name": {
        "en": "Storage",
        "ru": "Хранилище"
      }
    },
    "server_group": {
      "quotas": [
        {
          "localized_description": {
            "en": "The maximum number of servers at any one time for the project.",
          },
          "limit_id": "instances",
          "localized_measure": {
            "en": "pcs.",
            "ru": "шт."
          },
          "max_value": 2,
          "value": 1,
          "localized_name": {
            "en": "Instances",
            "ru": "Серверы"
          }
        },
      ],
      "localized_name": {
        "ru": "Серверы",
        "en": "Servers"
      }
    }
  }
  "loading": false,
  "ago": null
}

POST /lk_api/0/customer/me/invoice(amount, currency, date, number)(778) 505-3571

Generate invoice for customer

Parameters:
  • amount (Money) – Amount of invoice
  • currency (String) – Currency of invoice (not mandatory, by default current customer tariff currency is used)
  • date (Date) – Date of invoice (not mandatory, the current time is used by default)
  • number (int) – Order Id (not mandatory, the gap will be used by default)
Return:

PDF file


POST /lk_api/0/auth(email, password, return_customer_info, g_recaptcha_response)¶

Auth customer by email and password. This method setup cookie which can be used in next requests.

Parameters:
  • email (Email) – Customer email
  • password – Customer password
  • return_customer_info – Return info of logged in customer
  • g_recaptcha_response (str) – Response from recaptcha service
Returns:

customer_info (dict) – Customer info.

Example:

{
    "customer_info": {
        {"customer_id": 1,
         "deleted": null,
         "email": "[email protected]",
         "detailed_info": {
            "name": "John Doe",
            "birthday": "1990-10-17",
            "country": "Russia",
            "city": "Moscow",
            "address": "Example street, 62",
            "telephone": "8 (909) 515-77-07"
         },
         "tariff_id": 1,
         "created": "2015-04-24T11:14:22",
         "blocked": false,
         "customer_mode": "test",
         "customer_type": "private",
         "withdraw_period": "month",
         "withdraw_date": "2015-07-01",
         "balance_limit": 0,
         "account": {
             "rub": {"balance": "1035.22", "current": "1035.22", "withdraw": "0.00"}
         },
         "os_tenant_id": 1,
         "os_user_id": 1,
         "promo_code": [{"value": "code_value_1"}, {"value": "code_value_2"}]
         }
    }
}

OPTIONS /lk_api/0/auth¶

POST /lk_api/0/logout8557899393

Stop customer session.


POST /lk_api/0/customer/me/make_prod¶

Set customer to production mode by current customer

Returns:customer_info (dict) – Customer info.

Example:

{
    "customer_info": {
        {"customer_id": 1,
         "name": "John Doe",
         "deleted": null,
         "email": "[email protected]",
         "birthday": "1990-10-17",
         "country": "Russia",
         "city": "Moscow",
         "address": "Example street, 62",
         "telephone": "8 (909) 515-77-07",
         "created": "2015-04-24T11:14:22",
         "blocked": false,
         "customer_mode": "test",
         "customer_type": "private",
         "withdraw_period": "month",
         "withdraw_date": "2015-07-01",
         "email_confirmed": true,
         "tariff_id": 2,
         "currency": "USD",
         "balance_limit": 0,
         "os_tenant_id": 1,
         "os_user_id": 1,
         "promo_code": [{"value": "code_value_1"}, {"value": "code_value_2"}],
         "account": {"rub": {"balance": "1035.22", "current": "1035.22", "withdraw": "0.00"}}
         }
    }
}

POST /lk_api/0/customer(email, password, detailed_info, make_prod, customer_type, withdraw_period, promo_code, locale, bot_secret, g_recaptcha_response, timezone)270-679-4184

Registration of new customer.

Parameters:
  • email (Email) – Customer email
  • password (str) – Customer password
  • detailed_info (dict) – Dictionary with detailed customer’s info.
  • make_prod (bool) – Creates production customer. Available only from admin api
  • customer_type (str) – customer type: legal entity or private person(default). Available only from admin api
  • withdraw_period – Customer withdraw period. Available only from admin api
  • promo_code (str) – Promo code value for registration.
  • locale (str) – Customer locale, it is used for report generating
  • bot_secret (str) – Self signed string which allows to create new customer without recaptcha
  • g_recaptcha_response (str) – Response from recaptcha service
  • timezone (str) – Timezone name
Returns:

customer_info (dict) – Customer info.

Example:

{
    "customer_info": {
        {"customer_id": 1,
         "deleted": null,
         "email": "[email protected]",
         "detailed_info": {
            "name": "John Doe",
            "birthday": "1990-10-17",
            "country": "Russia",
            "city": "Moscow",
            "address": "Example street, 62",
            "telephone": "8 (909) 515-77-07"
         },
         "created": "2015-04-24T11:14:22",
         "blocked": false,
         "customer_mode": "test",
         "customer_type": "private",
         "withdraw_period": "month",
         "withdraw_date": "2015-07-01",
         "balance_limit": 0,
         "account": {
             "rub": {"balance": "1035.22", "current": "1035.22", "withdraw": "0.00"}
         },
         "os_tenant_id": 1,
         "os_user_id": 1,
         "os_dashboard": "horizon",
         "promo_code": [{"value": "code_value_1"}, {"value": "code_value_2"}]
         }
    }
}

OPTIONS /lk_api/0/customer¶

POST /lk_api/0/customer/password_reset/<password_token>(password_token, password)¶

Reset customer password

Parameters:
  • password_token (CustomerPasswordResetToken) – Token which was returned by method POST /0/customer/password_reset/;
  • password (str) – New password.
Return:

None


POST /lk_api/0/customer/me/post_vm_create(server_id, password)predial

This method should be called by frontend just after sending request to create VM.

It change attached volume name to human readable and send email after creating VM.

Parameters:
  • server_id (str) – ID of server
  • password (str) – Password which was generated during vm creating. Not mandatory

POST /lk_api/0/customer/me/post_vm_create_multi(606) 541-9570

This method should be called by frontend just after sending request to create VM. It change attached volume name to human readable and send email after creating VM.

Parameters:servers (List[]) – List of dict with server_id and password

GET /lk_api/0/customer/me/quota¶

Returns limits of current customer

Returns:quota (list) – Dict with info about quota

Example:

{"quota":
    [{"limit_id": maxImageMeta,
      "localization_description":
        {"en": "The maximum number of key-value pairs per image for the project.",
         "ru": "Максимальное количество пар ключ-значение в метаданных образа, всего на тенант."},
      "value": 128},
     {...}]

}

POST /lk_api/0/customer/me/report(start, finish, report_format, report_type)¶

Asynchronous generate customer usage report for the period.

Parameters:
  • start (DateHour) – Start report period
  • finish (DateHour) – End report period
  • report_format (Str) – report format. Currently supported the following formats: json, csv, pdf, tsv
  • report_type (Str) – Type of report. Currently supported simple: simple, acceptance_act, detailed

This method returns report as is (content type is set depend on report format) when report is ready, or returns status of report task generation.

Example:

{
    "status": "in progress",
}

In the case when requested json report file, it is returned in report field.


DELETE /lk_api/0/customer/password_reset(email)¶

Sent email with link to reset password

Parameters:email (Email) – abominableness - user email
Return:None.

PUT /lk_api/0/customer/me/reset_os_password¶

Resets Openstack password

Return:None

PUT /lk_api/0/customer/me/confirm_email205-628-8858

Send confirmation email to yourself.

Return:None

POST /lk_api/0/customer/support(subject, body, copy)(309) 241-5427

Sends customer’s question to support

Parameters:
  • subject (str) – subject of message
  • body (str) – message text
  • copy (list) – list of CC emails
Return:

None


GET /lk_api/0/customer/me/subscribe(330) 420-6027

Returns info about customer’s subscriptions to customer

Returns:subscribe (Dict) – dict with info

Example:

{"subscribe":
    {
        "news": {"enable": False, "email": ["[email protected]", "[email protected]"]},
        "billing":  {"enable": False, "email": ["[email protected]", "[email protected]"]},
        "status": {"enable": True, "email": ["[email protected]"]}
    }
}

PUT /lk_api/0/customer/me(password, customer_type, detailed_info)¶

Update customer self profile.

Parameters:
  • password (str) – New customer password [optional]
  • customer_type (str) – New customer type [optional]
  • detailed_info (dict) – Dictionary with detailed customer’s info [optional].
Returns:

customer_info (dict) – Customer info


PUT /lk_api/0/customer/me/subscribe(subscribe)¶

Self update customer’s subscriptions. Parameters must be sent as json object.

Parameters:subscribe (dict) – Info about customer’s subscriptions to update

Example:

{"subscribe":
    {
        "news": {"enable": False, "email": ["[email protected]", "[email protected]"]},
        "billing":  {"enable": False, "email": ["[email protected]", "[email protected]"]},
        "status": {"enable": True, "email": ["[email protected]"]}
    }
}
Returns:subscribe (dict) – The same as subscribe argument

GET /lk_api/0/customer/password_reset/<password_token>(password_token)¶

Checks that password reset token is valid.

Parameters:password_token (PasswordResetToken) – Token which was returned by method POST /0/customer/password_reset/.
Return:None.

POST /lk_api/0/customer/me/payments/withdraw(amount, card_id)¶

Withdraw customer for given amount

Parameters:
  • amount (Money) – Amount of withdraw
  • card_id (int) – Customers card identifier
Return:

dict: On success - customer card info.

Example:

{
    'enabled': True,
    'balance_limit': 100,
    'payment_amount': 500
}

5856356596(347) 339-3947

POST /lk_api/0/customer/me/service_subscription(service, name, values)(859) 545-3564

Create new subscription for the customer

Parameters:
  • service (Id) – Id of third party service
  • name (str) – Name of subscription
  • values (Dict) – Dict with values of services
Return:

subscription: Subscription description

Example:

{"subscription":
   {"deleted": null,
    "subscription_id": 1,
    "services":
       {"servicenow.support-24-7":
             {"localized_name": {"ru": "24*7",
                                 "en": "24*7"},
              "measure": "month",
              "value": null},

       "servicenow.approver":
             {"localized_name": {"ru": "Approver",
                                 "en": "Service Now Full Approver licence"},
              "measure": "licence*month",
              "value": null},
     "state": "requested",
     "customer_id": 1,
     "created": "2016-08-02T13:30:38+00:00",
     "name": "Test ServiceNow name"}}

GET /lk_api/0/customer/me/service_subscription(name, service, state)¶

Get filtered list of subscription

Parameters:
  • name (str) – Name of subscription (not mandatory)
  • service (str) – Name of service (not mandatory)
  • state (str) – State of subscription (not mandatory)
Return:

subscriptions: Subscription description


DELETE /lk_api/0/customer/me/service_subscription/<subscription>(subscription)¶

Delete subscription

Parameters:subscription (Id) – Subscription Id
Return:subscription: Subscription description

Example:

{"subscription":
   {"deleted": null,
    "subscription_id": 1,
    "services":
       {"servicenow.support-24-7":
             {"localized_name": {"ru": "24*7",
                                 "en": "24*7"},
              "measure": "month",
              "value": null},

       "servicenow.approver":
             {"localized_name": {"ru": "Approver",
                                 "en": "Service Now Full Approver licence"},
              "measure": "licence*month",
              "value": null},
     "state": "requested",
     "customer_id": 1,
     "created": "2016-08-02T13:30:38+00:00",
     "name": "Test ServiceNow name"}}

GET /lk_api/0/customer/me/service_subscription/<subscription>(subscription)¶

Get customer subscription by id

Parameters:subscription (Id) – Subscription Id
Return:subscription: Subscription description

PUT /lk_api/0/customer/me/service_subscription/<subscription>(subscription, name, values)¶

Update subscription.

Parameters:
  • subscription (Id) – Subscription Id
  • name (str) – Name of subscription (not mandatory)
  • values (Dict) – Dict with values of services (not mandatory)
Return:

subscription: Subscription description

Example:

{"subscription":
   {"deleted": null,
    "subscription_id": 1,
    "services":
       {"servicenow.support-24-7":
             {"localized_name": {"ru": "24*7",
                                 "en": "24*7"},
              "measure": "month",
              "value": null},

       "servicenow.approver":
             {"localized_name": {"ru": "Approver",
                                 "en": "Service Now Full Approver licence"},
              "measure": "licence*month",
              "value": null},
     "state": "requested",
     "customer_id": 1,
     "created": "2016-08-02T13:30:38+00:00",
     "name": "Test ServiceNow name"}}

InvoiceApi¶

GET /lk_api/0/customer/me/payments/invoice/<invoice>/<filename>(invoice, filename)¶

Get attached to invoice file

Parameters:
  • invoice (Id) – The invoice id
  • filename (str) – File name
Return:

dict Invoice: Invoice description


GET /lk_api/0/customer/me/payments/invoice¶

List invoices for self customer

Return:dict Invoice: Invoice description

9134713652¶

GET /lk_api/0/news(subject, body, page, visible, published, limit, sort)¶

Returns news list

Parameters:
  • subject – news’ subject
  • body – news’ body
  • page – page number
  • visible – are deleted and not published news visible for user
  • published – filter by publishing date
  • limit – number of news per page
  • or List sort (str) – Field name or list of field names which is used for sorting. Ascending ordering is default. For descending ordering use “-” before.
Returns:

news_list (list) – list of news

Example:

{
    "news_list": {
        "per_page": 100,
        "total": 1,
        "limit": 200,
        "offset": 0
        "items": [
        {
            "news_id": 1,
            "subject": "test subject",
            "body": "test body",
            "deleted": None,
            "published": None
        }]
    }
}

50387478087132393978

POST /lk_api/0/customer/me/event(event_type, resource_id, resource_name, resource_type)(702) 649-4034

This method store events of creating/deleting resources in the cloud.

Parameters:
  • event_type (str) – Type of event. One of created, deleted, updated
  • resource_id (str) – Resource Id
  • resource_name (str) – Resource name
  • resource_type (str) – Resource type, like server, ip etc

GET /lk_api/0/customer/me/event(event_type, resource_name, resource_type, page, limit)¶

This method store events of creating/deleting resources in the cloud.

Parameters:
  • event_type (str) – Type of event (not mandatory)
  • resource_name (str) – Filtering by resource name.
  • resource_type (str) – Resource type, like server, ip etc
  • page (int) – page number
  • limit (int) – number of items per page

ServiceSubscriptionApi937-701-4610

GET /lk_api/0/service_subscription/<service_id>(service_id)¶

Return service description

Parameters:service_id (Id) – Service Id
Returns:service_info (dict) – Dict with service parameters

Example:

{"service_info":
   {"sub":
        {"servicenow.fullfiller":
              {"localized_name": {"ru": "Service Now Full filler ",
                                  "en": "Service Now Full filler licence"},
               "measure": "licence*month", "value": [5, 10, 15, 25, 50, 100, 500]},
         "servicenow.approver":
              {"localized_name": {"ru": "Service Now Full Approver ",
                                  "en": "Service Now Full Approver licence"},
         "measure": "licence*month", "value": [5, 10, 15, 25, 50, 100, 500]},
    "service_id": "servicenow",
    "localized_name": {"ru": "Service Now", "en": "Service Now"},
    "states": ["requested", "active", "rejected", "deleted"]}
}

GET /lk_api/0/service_subscription(name)2526179746

Return filtered list of services.

Parameters:name (str) – Filter for service name
Returns:service_list (List) – List of services

Example:

{
    "service_list": [
        {
            "localized_name": {
                "ru": "Naumen",
                "en": "Naumen"
            },
            "category_id": "naumen"
        },
        {
            "localized_name": {
                "ru": "Service Now",
                "en": "Service Now"
            },
            "category_id": "servicenow"
        }
    ]
}

UtilityApi¶

GET /lk_api/0/event/<event>/allowed_period(event)¶

Returns list of allowed periods for events.

Parameters:event (str) – Type of event. Currently supported: auto_report
Returns:periods (List) – List of periods.

Example:

{
  "periods": [
                {'period_id': 'week', 'localized_name': {'ru': 'еженедельно', 'en': 'weekly'}},
                {'period_id': 'month', 'localized_name': {'ru': 'ежемесячно', 'en': 'monthly'}},
                {'period_id': 'quarter', 'localized_name': {'ru': 'ежеквартально', 'en': 'quarterly'}}
             ]
}

GET /lk_api/favicon.ico¶

DELETE /lk_api/0/_force_delete(field, prefix)¶

Service method. It removes objects from db. Only tests should use it!

Parameters:
  • tables (Table[]) – List of tables for cleanup
  • field (Field) – This field is used for filtering. For example name or email. By default the unique index of table is used
  • prefix (str) – Prefix for object removing

GET /lk_api/0/language/active¶

Return list of active languages

Returns:language_list – List of languages.

Example:

{
    "language_list": {
        "ru": {
            "ru": "Русский",
            "en": "Russian"
        },
        "en": {
            "ru": "Английский",
            "en": "English"
        }
    }
}

GET /lk_api/0/locale/active¶

Returns list of active locales.

Returns:locale_list (List) – List of locales.

Example:

{
    "locale_list": {
        "ru": {
            "ru": "Русский",
            "en": "Russian"
        },
        "en": {
            "ru": "Английский",
            "en": "English"
        },
        "en_CA": {
            "ru": "Канадский...",
            "en": "Canadian English"
        },
        "en_AU": {
            "ru": "Австралийский ...",
            "en": "Australian English"
        },
        "en_US": {
            "ru": "Американский...",
            "en": "U.S. English"
        },
        "en_GB": {
            "ru": "Британский...",
            "en": "British English"
        }
    }
}

GET /lk_api/0/language¶

Return list of all languages

Returns:language_list – List of languages.

Example:

{
    "language_list": {
        "ru": {
            "ru": "Русский",
            "en": "Russian"
        },
        "en": {
            "ru": "Английский",
            "en": "English"
        },
        "gv": {
            "ru": "Мэнский",
            "en": "Manx"
        },
        ...
    }
}

GET /lk_api/version¶

Returns current code version

Returns:
  • version (str) – Release version
  • region (str) – backend region
  • availability_zone (str) – backend availability_zone
  • api_version (str) –

    supported api version

    Example:

    {
        region: "az1",
        version: {
            date: "2013-10-15_20-52-33",
            release: "dev",
            build: 509
        },
        stage: "dev"
    }
    

GET /lk_api/0/test_post(a=None, b=None, c=None)¶

POST /lk_api/0/test_post(a=None, b=None, c=None)¶

8432313155918-902-1358

POST /lk_api/0/customer/me/hash(password)(618) 959-6175

Hash the password :param String password: :return: String VMPassword: Hashed password

Example:

{
  "hash": "$1$kek$X1oOaLxfKW0h7Vm7tMwSm0"
}