pnap_billing_api 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +187 -0
- data/Rakefile +10 -0
- data/VERSION +1 -0
- data/docs/ApplicableDiscounts.md +20 -0
- data/docs/BandwidthDetails.md +24 -0
- data/docs/BandwidthRecord.md +56 -0
- data/docs/BillingConfigurationsApi.md +74 -0
- data/docs/ConfigurationDetails.md +18 -0
- data/docs/DiscountDetails.md +22 -0
- data/docs/Error.md +20 -0
- data/docs/LocationAvailabilityDetail.md +26 -0
- data/docs/LocationEnum.md +15 -0
- data/docs/OperatingSystemDetails.md +20 -0
- data/docs/OperatingSystemRecord.md +56 -0
- data/docs/PriceUnitEnum.md +15 -0
- data/docs/PricingPlan.md +36 -0
- data/docs/Product.md +22 -0
- data/docs/ProductAvailability.md +22 -0
- data/docs/ProductCategoryEnum.md +15 -0
- data/docs/ProductsApi.md +167 -0
- data/docs/ProductsGet200ResponseInner.md +82 -0
- data/docs/PublicSubnetDetails.md +22 -0
- data/docs/PublicSubnetRecord.md +56 -0
- data/docs/RatedUsageApi.md +155 -0
- data/docs/RatedUsageGet200ResponseInner.md +88 -0
- data/docs/RatedUsageRecord.md +54 -0
- data/docs/Reservation.md +48 -0
- data/docs/ReservationAutoRenewDisableRequest.md +18 -0
- data/docs/ReservationInvoicingModelEnum.md +15 -0
- data/docs/ReservationModelEnum.md +15 -0
- data/docs/ReservationRequest.md +18 -0
- data/docs/ReservationsApi.md +439 -0
- data/docs/ServerDetails.md +20 -0
- data/docs/ServerProduct.md +24 -0
- data/docs/ServerProductMetadata.md +30 -0
- data/docs/ServerRecord.md +56 -0
- data/docs/StorageDetails.md +28 -0
- data/docs/StorageRecord.md +56 -0
- data/docs/ThresholdConfigurationDetails.md +18 -0
- data/lib/pnap_billing_api/api/billing_configurations_api.rb +79 -0
- data/lib/pnap_billing_api/api/products_api.rb +174 -0
- data/lib/pnap_billing_api/api/rated_usage_api.rb +156 -0
- data/lib/pnap_billing_api/api/reservations_api.rb +412 -0
- data/lib/pnap_billing_api/api_client.rb +397 -0
- data/lib/pnap_billing_api/api_error.rb +58 -0
- data/lib/pnap_billing_api/configuration.rb +298 -0
- data/lib/pnap_billing_api/models/applicable_discounts.rb +227 -0
- data/lib/pnap_billing_api/models/bandwidth_details.rb +294 -0
- data/lib/pnap_billing_api/models/bandwidth_record.rb +548 -0
- data/lib/pnap_billing_api/models/configuration_details.rb +215 -0
- data/lib/pnap_billing_api/models/discount_details.rb +291 -0
- data/lib/pnap_billing_api/models/error.rb +234 -0
- data/lib/pnap_billing_api/models/location_availability_detail.rb +314 -0
- data/lib/pnap_billing_api/models/location_enum.rb +45 -0
- data/lib/pnap_billing_api/models/operating_system_details.rb +240 -0
- data/lib/pnap_billing_api/models/operating_system_record.rb +548 -0
- data/lib/pnap_billing_api/models/price_unit_enum.rb +44 -0
- data/lib/pnap_billing_api/models/pricing_plan.rb +397 -0
- data/lib/pnap_billing_api/models/product.rb +252 -0
- data/lib/pnap_billing_api/models/product_availability.rb +258 -0
- data/lib/pnap_billing_api/models/product_category_enum.rb +43 -0
- data/lib/pnap_billing_api/models/products_get200_response_inner.rb +61 -0
- data/lib/pnap_billing_api/models/public_subnet_details.rb +250 -0
- data/lib/pnap_billing_api/models/public_subnet_record.rb +548 -0
- data/lib/pnap_billing_api/models/rated_usage_get200_response_inner.rb +64 -0
- data/lib/pnap_billing_api/models/rated_usage_record.rb +526 -0
- data/lib/pnap_billing_api/models/reservation.rb +466 -0
- data/lib/pnap_billing_api/models/reservation_auto_renew_disable_request.rb +215 -0
- data/lib/pnap_billing_api/models/reservation_invoicing_model_enum.rb +40 -0
- data/lib/pnap_billing_api/models/reservation_model_enum.rb +43 -0
- data/lib/pnap_billing_api/models/reservation_request.rb +223 -0
- data/lib/pnap_billing_api/models/server_details.rb +240 -0
- data/lib/pnap_billing_api/models/server_product.rb +274 -0
- data/lib/pnap_billing_api/models/server_product_metadata.rb +325 -0
- data/lib/pnap_billing_api/models/server_record.rb +548 -0
- data/lib/pnap_billing_api/models/storage_details.rb +308 -0
- data/lib/pnap_billing_api/models/storage_record.rb +548 -0
- data/lib/pnap_billing_api/models/threshold_configuration_details.rb +223 -0
- data/lib/pnap_billing_api/version.rb +19 -0
- data/lib/pnap_billing_api.rb +75 -0
- data/pnap_billing_api.gemspec +39 -0
- data/spec/api/billing_configurations_api_spec.rb +46 -0
- data/spec/api/products_api_spec.rb +67 -0
- data/spec/api/rated_usage_api_spec.rb +61 -0
- data/spec/api/reservations_api_spec.rb +109 -0
- data/spec/models/applicable_discounts_spec.rb +42 -0
- data/spec/models/bandwidth_details_spec.rb +58 -0
- data/spec/models/bandwidth_record_spec.rb +154 -0
- data/spec/models/configuration_details_spec.rb +36 -0
- data/spec/models/discount_details_spec.rb +52 -0
- data/spec/models/error_spec.rb +42 -0
- data/spec/models/location_availability_detail_spec.rb +64 -0
- data/spec/models/location_enum_spec.rb +30 -0
- data/spec/models/operating_system_details_spec.rb +42 -0
- data/spec/models/operating_system_record_spec.rb +154 -0
- data/spec/models/price_unit_enum_spec.rb +30 -0
- data/spec/models/pricing_plan_spec.rb +102 -0
- data/spec/models/product_availability_spec.rb +48 -0
- data/spec/models/product_category_enum_spec.rb +30 -0
- data/spec/models/product_spec.rb +48 -0
- data/spec/models/products_get200_response_inner_spec.rb +44 -0
- data/spec/models/public_subnet_details_spec.rb +48 -0
- data/spec/models/public_subnet_record_spec.rb +154 -0
- data/spec/models/rated_usage_get200_response_inner_spec.rb +44 -0
- data/spec/models/rated_usage_record_spec.rb +148 -0
- data/spec/models/reservation_auto_renew_disable_request_spec.rb +36 -0
- data/spec/models/reservation_invoicing_model_enum_spec.rb +30 -0
- data/spec/models/reservation_model_enum_spec.rb +30 -0
- data/spec/models/reservation_request_spec.rb +36 -0
- data/spec/models/reservation_spec.rb +130 -0
- data/spec/models/server_details_spec.rb +42 -0
- data/spec/models/server_product_metadata_spec.rb +72 -0
- data/spec/models/server_product_spec.rb +54 -0
- data/spec/models/server_record_spec.rb +154 -0
- data/spec/models/storage_details_spec.rb +66 -0
- data/spec/models/storage_record_spec.rb +154 -0
- data/spec/models/threshold_configuration_details_spec.rb +36 -0
- data/spec/spec_helper.rb +111 -0
- metadata +240 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 90aaa7e94c20034a1a3d60e538f24edeb2df60a101c39455a667c15027a7d9d7
|
4
|
+
data.tar.gz: 38aa25e461ca137de61053aed52a7bd4674e8a885cad43a48d7866289dc248c5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f2a8c17c43abe5fa18de55e01fee40786c2c03748c0c019d72523093fe55618120a57ee355416747ff1cc2caba792f70065a786e3aba800ce4345af8e9205cbc
|
7
|
+
data.tar.gz: ba71acc4a3c4385c3caa409f171d57bc323af26d29165391d505b15f155cbe6c68877f076b33503d542a1d15fbf56dfc3190eaee9fc78f352b132b772a968251
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,187 @@
|
|
1
|
+
# pnap_billing_api
|
2
|
+
|
3
|
+
BillingApi - the Ruby gem for the Billing API
|
4
|
+
|
5
|
+
Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to
|
6
|
+
ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a
|
7
|
+
given period and enable or disable auto-renewals.<br>
|
8
|
+
<br>
|
9
|
+
<span class='pnap-api-knowledge-base-link'>
|
10
|
+
Knowledge base articles to help you can be found
|
11
|
+
<a href='https://phoenixnap.com/kb/phoenixnap-bare-metal-cloud-billing-models' target='_blank'>here</a>
|
12
|
+
</span><br>
|
13
|
+
<br>
|
14
|
+
<b>All URLs are relative to (https://api.phoenixnap.com/billing/v1/)</b>
|
15
|
+
|
16
|
+
|
17
|
+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
18
|
+
|
19
|
+
- API version: 0.1
|
20
|
+
For more information, please visit [https://phoenixnap.com/](https://phoenixnap.com/)
|
21
|
+
|
22
|
+
## Installation
|
23
|
+
|
24
|
+
### Build a gem
|
25
|
+
|
26
|
+
To build the Ruby code into a gem:
|
27
|
+
|
28
|
+
```shell
|
29
|
+
gem build pnap_billing_api.gemspec
|
30
|
+
```
|
31
|
+
|
32
|
+
Then either install the gem locally, replacing `<VERSION>` with the actual version:
|
33
|
+
|
34
|
+
```shell
|
35
|
+
gem install ./pnap_billing_api-<VERSION>.gem
|
36
|
+
```
|
37
|
+
|
38
|
+
(for development, run `gem install --dev ./pnap_billing_api-<VERSION>.gem` to install the development dependencies)
|
39
|
+
|
40
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
41
|
+
|
42
|
+
Finally add this to the Gemfile:
|
43
|
+
|
44
|
+
gem 'pnap_billing_api', '~> <VERSION>'
|
45
|
+
|
46
|
+
### Install from Git
|
47
|
+
|
48
|
+
To install this Gem from this repository, you'll need to get Bundler by doing `gem install bundler`. Add the following line in your Gemfile:
|
49
|
+
|
50
|
+
gem 'pnap_billing_api', git: 'https://github.com/phoenixnap/ruby-sdk-bmc-poc', glob: 'BillingApi/*.gemspec'
|
51
|
+
|
52
|
+
If you'd like the development version:
|
53
|
+
|
54
|
+
gem 'pnap_billing_api', git: 'https://github.com/phoenixnap/ruby-sdk-bmc-poc', glob: 'BillingApi/*.gemspec', branch: 'develop'
|
55
|
+
|
56
|
+
Then run `bundle install`.
|
57
|
+
|
58
|
+
### Include the Ruby code directly
|
59
|
+
|
60
|
+
Include the Ruby code directly using `-I` as follows:
|
61
|
+
|
62
|
+
```shell
|
63
|
+
ruby -Ilib script.rb
|
64
|
+
```
|
65
|
+
|
66
|
+
## Getting Started
|
67
|
+
|
68
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
69
|
+
|
70
|
+
```ruby
|
71
|
+
# Load the gem
|
72
|
+
require 'pnap_billing_api'
|
73
|
+
|
74
|
+
# Setup authorization
|
75
|
+
BillingApi.configure do |config|
|
76
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
77
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
78
|
+
# Configure a proc to get access tokens in lieu of the static access_token configuration
|
79
|
+
config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' }
|
80
|
+
end
|
81
|
+
|
82
|
+
api_instance = BillingApi::BillingConfigurationsApi.new
|
83
|
+
|
84
|
+
begin
|
85
|
+
#Retrieves billing configuration associated with the authenticated account.
|
86
|
+
result = api_instance.account_billing_configuration_me_get
|
87
|
+
p result
|
88
|
+
rescue BillingApi::ApiError => e
|
89
|
+
puts "Exception when calling BillingConfigurationsApi->account_billing_configuration_me_get: #{e}"
|
90
|
+
end
|
91
|
+
|
92
|
+
```
|
93
|
+
|
94
|
+
Authorization can also be setup by using the [`oauth`](https://github.com/oauth-xx/oauth2) library:
|
95
|
+
|
96
|
+
```ruby
|
97
|
+
# Load the gem
|
98
|
+
require 'pnap_billing_api'
|
99
|
+
require 'oauth2'
|
100
|
+
|
101
|
+
# Setup variables for getting a token.
|
102
|
+
client_id = 'YOUR_CLIENT_ID'
|
103
|
+
client_secret = 'YOUR_CLIENT_SECRET'
|
104
|
+
auth_url = 'https://auth.phoenixnap.com/auth/realms/BMC/protocol/openid-connect/token'
|
105
|
+
|
106
|
+
|
107
|
+
# Setup authorization
|
108
|
+
BillingApi.configure do |config|
|
109
|
+
# Retrieve the token using OAuth2.
|
110
|
+
client = OAuth2::Client.new(client_id, client_secret, token_url: auth_url)
|
111
|
+
token = client.client_credentials.get_token
|
112
|
+
|
113
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
114
|
+
config.access_token = token.token
|
115
|
+
end
|
116
|
+
|
117
|
+
```
|
118
|
+
|
119
|
+
## Documentation for API Endpoints
|
120
|
+
|
121
|
+
All URIs are relative to *https://api.phoenixnap.com/billing/v1*
|
122
|
+
|
123
|
+
Class | Method | HTTP request | Description
|
124
|
+
------------ | ------------- | ------------- | -------------
|
125
|
+
*BillingApi::BillingConfigurationsApi* | [**account_billing_configuration_me_get**](docs/BillingConfigurationsApi.md#account_billing_configuration_me_get) | **GET** /account-billing-configurations/me | Retrieves billing configuration associated with the authenticated account.
|
126
|
+
*BillingApi::ProductsApi* | [**product_availability_get**](docs/ProductsApi.md#product_availability_get) | **GET** /product-availability | List all Product availabilities.
|
127
|
+
*BillingApi::ProductsApi* | [**products_get**](docs/ProductsApi.md#products_get) | **GET** /products | List all Products.
|
128
|
+
*BillingApi::RatedUsageApi* | [**rated_usage_get**](docs/RatedUsageApi.md#rated_usage_get) | **GET** /rated-usage | List the rated usage.
|
129
|
+
*BillingApi::RatedUsageApi* | [**rated_usage_month_to_date_get**](docs/RatedUsageApi.md#rated_usage_month_to_date_get) | **GET** /rated-usage/month-to-date | List the rated usage records for the current calendar month.
|
130
|
+
*BillingApi::ReservationsApi* | [**reservations_get**](docs/ReservationsApi.md#reservations_get) | **GET** /reservations | List all Reservations.
|
131
|
+
*BillingApi::ReservationsApi* | [**reservations_post**](docs/ReservationsApi.md#reservations_post) | **POST** /reservations | Create a reservation.
|
132
|
+
*BillingApi::ReservationsApi* | [**reservations_reservation_id_actions_auto_renew_disable_post**](docs/ReservationsApi.md#reservations_reservation_id_actions_auto_renew_disable_post) | **POST** /reservations/{reservationId}/actions/auto-renew/disable | Disable auto-renewal for reservation by id.
|
133
|
+
*BillingApi::ReservationsApi* | [**reservations_reservation_id_actions_auto_renew_enable_post**](docs/ReservationsApi.md#reservations_reservation_id_actions_auto_renew_enable_post) | **POST** /reservations/{reservationId}/actions/auto-renew/enable | Enable auto-renewal for unexpired reservation by reservation id.
|
134
|
+
*BillingApi::ReservationsApi* | [**reservations_reservation_id_actions_convert_post**](docs/ReservationsApi.md#reservations_reservation_id_actions_convert_post) | **POST** /reservations/{reservationId}/actions/convert | Convert reservation pricing model by reservation ID.
|
135
|
+
*BillingApi::ReservationsApi* | [**reservations_reservation_id_get**](docs/ReservationsApi.md#reservations_reservation_id_get) | **GET** /reservations/{reservationId} | Get a reservation.
|
136
|
+
|
137
|
+
|
138
|
+
## Documentation for Models
|
139
|
+
|
140
|
+
- [BillingApi::ApplicableDiscounts](docs/ApplicableDiscounts.md)
|
141
|
+
- [BillingApi::BandwidthDetails](docs/BandwidthDetails.md)
|
142
|
+
- [BillingApi::BandwidthRecord](docs/BandwidthRecord.md)
|
143
|
+
- [BillingApi::ConfigurationDetails](docs/ConfigurationDetails.md)
|
144
|
+
- [BillingApi::DiscountDetails](docs/DiscountDetails.md)
|
145
|
+
- [BillingApi::Error](docs/Error.md)
|
146
|
+
- [BillingApi::LocationAvailabilityDetail](docs/LocationAvailabilityDetail.md)
|
147
|
+
- [BillingApi::LocationEnum](docs/LocationEnum.md)
|
148
|
+
- [BillingApi::OperatingSystemDetails](docs/OperatingSystemDetails.md)
|
149
|
+
- [BillingApi::OperatingSystemRecord](docs/OperatingSystemRecord.md)
|
150
|
+
- [BillingApi::PriceUnitEnum](docs/PriceUnitEnum.md)
|
151
|
+
- [BillingApi::PricingPlan](docs/PricingPlan.md)
|
152
|
+
- [BillingApi::Product](docs/Product.md)
|
153
|
+
- [BillingApi::ProductAvailability](docs/ProductAvailability.md)
|
154
|
+
- [BillingApi::ProductCategoryEnum](docs/ProductCategoryEnum.md)
|
155
|
+
- [BillingApi::ProductsGet200ResponseInner](docs/ProductsGet200ResponseInner.md)
|
156
|
+
- [BillingApi::PublicSubnetDetails](docs/PublicSubnetDetails.md)
|
157
|
+
- [BillingApi::PublicSubnetRecord](docs/PublicSubnetRecord.md)
|
158
|
+
- [BillingApi::RatedUsageGet200ResponseInner](docs/RatedUsageGet200ResponseInner.md)
|
159
|
+
- [BillingApi::RatedUsageRecord](docs/RatedUsageRecord.md)
|
160
|
+
- [BillingApi::Reservation](docs/Reservation.md)
|
161
|
+
- [BillingApi::ReservationAutoRenewDisableRequest](docs/ReservationAutoRenewDisableRequest.md)
|
162
|
+
- [BillingApi::ReservationInvoicingModelEnum](docs/ReservationInvoicingModelEnum.md)
|
163
|
+
- [BillingApi::ReservationModelEnum](docs/ReservationModelEnum.md)
|
164
|
+
- [BillingApi::ReservationRequest](docs/ReservationRequest.md)
|
165
|
+
- [BillingApi::ServerDetails](docs/ServerDetails.md)
|
166
|
+
- [BillingApi::ServerProduct](docs/ServerProduct.md)
|
167
|
+
- [BillingApi::ServerProductMetadata](docs/ServerProductMetadata.md)
|
168
|
+
- [BillingApi::ServerRecord](docs/ServerRecord.md)
|
169
|
+
- [BillingApi::StorageDetails](docs/StorageDetails.md)
|
170
|
+
- [BillingApi::StorageRecord](docs/StorageRecord.md)
|
171
|
+
- [BillingApi::ThresholdConfigurationDetails](docs/ThresholdConfigurationDetails.md)
|
172
|
+
|
173
|
+
|
174
|
+
## Documentation for Authorization
|
175
|
+
|
176
|
+
|
177
|
+
Authentication schemes defined for the API:
|
178
|
+
### OAuth2
|
179
|
+
|
180
|
+
|
181
|
+
- **Type**: OAuth
|
182
|
+
- **Flow**: application
|
183
|
+
- **Authorization URL**:
|
184
|
+
- **Scopes**:
|
185
|
+
- bmc: Grants full access to bmc-api.
|
186
|
+
- bmc.read: Grants read only access to bmc-api.
|
187
|
+
|
data/Rakefile
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# BillingApi::ApplicableDiscounts
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **discounted_price** | **Float** | The price of the product after applying a discount. | [optional] |
|
8
|
+
| **discount_details** | [**Array<DiscountDetails>**](DiscountDetails.md) | | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'pnap_billing_api'
|
14
|
+
|
15
|
+
instance = BillingApi::ApplicableDiscounts.new(
|
16
|
+
discounted_price: 107.5,
|
17
|
+
discount_details: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# BillingApi::BandwidthDetails
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **ingress_gb** | **Float** | The amount of GB consumed in ingress (IN). | |
|
8
|
+
| **egress_gb** | **Float** | The amount of GB consumed in egress (OUT). | |
|
9
|
+
| **package_quantity** | **Float** | Package size per month. | [optional] |
|
10
|
+
| **package_unit** | **String** | Package size unit. | [optional] |
|
11
|
+
|
12
|
+
## Example
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'pnap_billing_api'
|
16
|
+
|
17
|
+
instance = BillingApi::BandwidthDetails.new(
|
18
|
+
ingress_gb: 1.33,
|
19
|
+
egress_gb: 1.33,
|
20
|
+
package_quantity: 15,
|
21
|
+
package_unit: null
|
22
|
+
)
|
23
|
+
```
|
24
|
+
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# BillingApi::BandwidthRecord
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **String** | The unique identifier of the rated usage record. | |
|
8
|
+
| **product_category** | **String** | The category of the product associated with this usage record. | |
|
9
|
+
| **product_code** | **String** | The code identifying the product associated to this usage record. | |
|
10
|
+
| **location** | [**LocationEnum**](LocationEnum.md) | | |
|
11
|
+
| **year_month** | **String** | Year and month of the usage record. | [optional] |
|
12
|
+
| **start_date_time** | **Time** | The point in time (in UTC) when usage has started. | |
|
13
|
+
| **end_date_time** | **Time** | The point in time (in UTC) until usage has been rated. | |
|
14
|
+
| **cost** | **Integer** | The rated usage in cents. | |
|
15
|
+
| **cost_before_discount** | **Integer** | The cost in cents before discount. | [optional] |
|
16
|
+
| **cost_description** | **String** | The rated usage cost description. | [optional] |
|
17
|
+
| **price_model** | **String** | The price model applied to this usage record. | |
|
18
|
+
| **unit_price** | **Float** | The unit price. | |
|
19
|
+
| **unit_price_description** | **String** | User friendly description of the unit price. | |
|
20
|
+
| **quantity** | **Float** | The number of units being charged. | |
|
21
|
+
| **active** | **Boolean** | A flag indicating whether the rated usage record is still active. | |
|
22
|
+
| **usage_session_id** | **String** | The usage session ID is used to correlate rated usage records across periods of time. For example, a server used for over a month will generate multiple rated usage records. The entire usage session cost can be computed by aggregating the records having the same usage session ID. It is usual to have one rated usage record per month or invoice. | |
|
23
|
+
| **correlation_id** | **String** | Holds usage record id | |
|
24
|
+
| **reservation_id** | **String** | Reservation id associated with this rated usage record. | [optional] |
|
25
|
+
| **discount_details** | [**DiscountDetails**](DiscountDetails.md) | | [optional] |
|
26
|
+
| **metadata** | [**BandwidthDetails**](BandwidthDetails.md) | | |
|
27
|
+
|
28
|
+
## Example
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
require 'pnap_billing_api'
|
32
|
+
|
33
|
+
instance = BillingApi::BandwidthRecord.new(
|
34
|
+
id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
|
35
|
+
product_category: bmc-server,
|
36
|
+
product_code: s1.c1.small,
|
37
|
+
location: null,
|
38
|
+
year_month: 2020-03,
|
39
|
+
start_date_time: 2020-03-19T16:39Z,
|
40
|
+
end_date_time: 2020-03-20T17:00Z,
|
41
|
+
cost: 384,
|
42
|
+
cost_before_discount: 15456,
|
43
|
+
cost_description: 24 Hour(s) @ $0.16 /Hour,
|
44
|
+
price_model: hourly,
|
45
|
+
unit_price: 0.16,
|
46
|
+
unit_price_description: per hour,
|
47
|
+
quantity: 24,
|
48
|
+
active: true,
|
49
|
+
usage_session_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
|
50
|
+
correlation_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
|
51
|
+
reservation_id: c32a24a1-5949-4b60-99c0-c8aaa3a92b04,
|
52
|
+
discount_details: null,
|
53
|
+
metadata: null
|
54
|
+
)
|
55
|
+
```
|
56
|
+
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# BillingApi::BillingConfigurationsApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://api.phoenixnap.com/billing/v1*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**account_billing_configuration_me_get**](BillingConfigurationsApi.md#account_billing_configuration_me_get) | **GET** /account-billing-configurations/me | Retrieves billing configuration associated with the authenticated account. |
|
8
|
+
|
9
|
+
|
10
|
+
## account_billing_configuration_me_get
|
11
|
+
|
12
|
+
> <ConfigurationDetails> account_billing_configuration_me_get
|
13
|
+
|
14
|
+
Retrieves billing configuration associated with the authenticated account.
|
15
|
+
|
16
|
+
Retrieves billing configuration associated with the authenticated account.
|
17
|
+
|
18
|
+
### Examples
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
require 'time'
|
22
|
+
require 'pnap_billing_api'
|
23
|
+
# setup authorization
|
24
|
+
BillingApi.configure do |config|
|
25
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
26
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
27
|
+
end
|
28
|
+
|
29
|
+
api_instance = BillingApi::BillingConfigurationsApi.new
|
30
|
+
|
31
|
+
begin
|
32
|
+
# Retrieves billing configuration associated with the authenticated account.
|
33
|
+
result = api_instance.account_billing_configuration_me_get
|
34
|
+
p result
|
35
|
+
rescue BillingApi::ApiError => e
|
36
|
+
puts "Error when calling BillingConfigurationsApi->account_billing_configuration_me_get: #{e}"
|
37
|
+
end
|
38
|
+
```
|
39
|
+
|
40
|
+
#### Using the account_billing_configuration_me_get_with_http_info variant
|
41
|
+
|
42
|
+
This returns an Array which contains the response data, status code and headers.
|
43
|
+
|
44
|
+
> <Array(<ConfigurationDetails>, Integer, Hash)> account_billing_configuration_me_get_with_http_info
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
begin
|
48
|
+
# Retrieves billing configuration associated with the authenticated account.
|
49
|
+
data, status_code, headers = api_instance.account_billing_configuration_me_get_with_http_info
|
50
|
+
p status_code # => 2xx
|
51
|
+
p headers # => { ... }
|
52
|
+
p data # => <ConfigurationDetails>
|
53
|
+
rescue BillingApi::ApiError => e
|
54
|
+
puts "Error when calling BillingConfigurationsApi->account_billing_configuration_me_get_with_http_info: #{e}"
|
55
|
+
end
|
56
|
+
```
|
57
|
+
|
58
|
+
### Parameters
|
59
|
+
|
60
|
+
This endpoint does not need any parameter.
|
61
|
+
|
62
|
+
### Return type
|
63
|
+
|
64
|
+
[**ConfigurationDetails**](ConfigurationDetails.md)
|
65
|
+
|
66
|
+
### Authorization
|
67
|
+
|
68
|
+
[OAuth2](../README.md#OAuth2)
|
69
|
+
|
70
|
+
### HTTP request headers
|
71
|
+
|
72
|
+
- **Content-Type**: Not defined
|
73
|
+
- **Accept**: application/json
|
74
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# BillingApi::ConfigurationDetails
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **threshold_configuration** | [**ThresholdConfigurationDetails**](ThresholdConfigurationDetails.md) | | [optional] |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'pnap_billing_api'
|
13
|
+
|
14
|
+
instance = BillingApi::ConfigurationDetails.new(
|
15
|
+
threshold_configuration: null
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# BillingApi::DiscountDetails
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **code** | **String** | A unique code associated with the discount. | |
|
8
|
+
| **type** | **String** | The type of discount applied. | |
|
9
|
+
| **value** | **Float** | The value or amount of the discount. The interpretation of this value depends on the 'type' of discount. | |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'pnap_billing_api'
|
15
|
+
|
16
|
+
instance = BillingApi::DiscountDetails.new(
|
17
|
+
code: new-year-2022-monthly,
|
18
|
+
type: PRODUCT_CATEGORY_PERCENTAGE,
|
19
|
+
value: 20.5
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
data/docs/Error.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# BillingApi::Error
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **message** | **String** | The description detailing the cause of the error code. | [readonly] |
|
8
|
+
| **validation_errors** | **Array<String>** | Validation errors, if any. | [optional][readonly] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'pnap_billing_api'
|
14
|
+
|
15
|
+
instance = BillingApi::Error.new(
|
16
|
+
message: null,
|
17
|
+
validation_errors: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# BillingApi::LocationAvailabilityDetail
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **location** | [**LocationEnum**](LocationEnum.md) | | |
|
8
|
+
| **min_quantity_requested** | **Float** | Requested quantity. | |
|
9
|
+
| **min_quantity_available** | **Boolean** | Is product available in specific location for requested quantity | |
|
10
|
+
| **available_quantity** | **Float** | Total available quantity of product in specific location. Max value is 10. | |
|
11
|
+
| **solutions** | **Array<String>** | Solutions supported in specific location for a product. | |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'pnap_billing_api'
|
17
|
+
|
18
|
+
instance = BillingApi::LocationAvailabilityDetail.new(
|
19
|
+
location: null,
|
20
|
+
min_quantity_requested: 2,
|
21
|
+
min_quantity_available: true,
|
22
|
+
available_quantity: 5,
|
23
|
+
solutions: null
|
24
|
+
)
|
25
|
+
```
|
26
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# BillingApi::OperatingSystemDetails
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **cores** | **Integer** | Number of cores. | |
|
8
|
+
| **correlation_id** | **String** | Correlation is used to associate Operating System License charges and the Server on which it was installed. In this scenario, the correlation ID will be equal to the rated usage record ID representing the charge for the Server. | |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'pnap_billing_api'
|
14
|
+
|
15
|
+
instance = BillingApi::OperatingSystemDetails.new(
|
16
|
+
cores: 2,
|
17
|
+
correlation_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# BillingApi::OperatingSystemRecord
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **String** | The unique identifier of the rated usage record. | |
|
8
|
+
| **product_category** | **String** | The category of the product associated with this usage record. | |
|
9
|
+
| **product_code** | **String** | The code identifying the product associated to this usage record. | |
|
10
|
+
| **location** | [**LocationEnum**](LocationEnum.md) | | |
|
11
|
+
| **year_month** | **String** | Year and month of the usage record. | [optional] |
|
12
|
+
| **start_date_time** | **Time** | The point in time (in UTC) when usage has started. | |
|
13
|
+
| **end_date_time** | **Time** | The point in time (in UTC) until usage has been rated. | |
|
14
|
+
| **cost** | **Integer** | The rated usage in cents. | |
|
15
|
+
| **cost_before_discount** | **Integer** | The cost in cents before discount. | [optional] |
|
16
|
+
| **cost_description** | **String** | The rated usage cost description. | [optional] |
|
17
|
+
| **price_model** | **String** | The price model applied to this usage record. | |
|
18
|
+
| **unit_price** | **Float** | The unit price. | |
|
19
|
+
| **unit_price_description** | **String** | User friendly description of the unit price. | |
|
20
|
+
| **quantity** | **Float** | The number of units being charged. | |
|
21
|
+
| **active** | **Boolean** | A flag indicating whether the rated usage record is still active. | |
|
22
|
+
| **usage_session_id** | **String** | The usage session ID is used to correlate rated usage records across periods of time. For example, a server used for over a month will generate multiple rated usage records. The entire usage session cost can be computed by aggregating the records having the same usage session ID. It is usual to have one rated usage record per month or invoice. | |
|
23
|
+
| **correlation_id** | **String** | Holds usage record id | |
|
24
|
+
| **reservation_id** | **String** | Reservation id associated with this rated usage record. | [optional] |
|
25
|
+
| **discount_details** | [**DiscountDetails**](DiscountDetails.md) | | [optional] |
|
26
|
+
| **metadata** | [**OperatingSystemDetails**](OperatingSystemDetails.md) | | |
|
27
|
+
|
28
|
+
## Example
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
require 'pnap_billing_api'
|
32
|
+
|
33
|
+
instance = BillingApi::OperatingSystemRecord.new(
|
34
|
+
id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
|
35
|
+
product_category: bmc-server,
|
36
|
+
product_code: s1.c1.small,
|
37
|
+
location: null,
|
38
|
+
year_month: 2020-03,
|
39
|
+
start_date_time: 2020-03-19T16:39Z,
|
40
|
+
end_date_time: 2020-03-20T17:00Z,
|
41
|
+
cost: 384,
|
42
|
+
cost_before_discount: 15456,
|
43
|
+
cost_description: 24 Hour(s) @ $0.16 /Hour,
|
44
|
+
price_model: hourly,
|
45
|
+
unit_price: 0.16,
|
46
|
+
unit_price_description: per hour,
|
47
|
+
quantity: 24,
|
48
|
+
active: true,
|
49
|
+
usage_session_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
|
50
|
+
correlation_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
|
51
|
+
reservation_id: c32a24a1-5949-4b60-99c0-c8aaa3a92b04,
|
52
|
+
discount_details: null,
|
53
|
+
metadata: null
|
54
|
+
)
|
55
|
+
```
|
56
|
+
|
data/docs/PricingPlan.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# BillingApi::PricingPlan
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **sku** | **String** | The SKU identifying this pricing plan. | |
|
8
|
+
| **sku_description** | **String** | Description of this pricing plan. | [optional] |
|
9
|
+
| **location** | **String** | The code identifying the location. | |
|
10
|
+
| **pricing_model** | **String** | The pricing model. | |
|
11
|
+
| **price** | **Float** | The price per unit. | |
|
12
|
+
| **price_unit** | [**PriceUnitEnum**](PriceUnitEnum.md) | | |
|
13
|
+
| **applicable_discounts** | [**ApplicableDiscounts**](ApplicableDiscounts.md) | | [optional] |
|
14
|
+
| **correlated_product_code** | **String** | Product code of the product this product is correlated with | [optional] |
|
15
|
+
| **package_quantity** | **Float** | Package size per month. | [optional] |
|
16
|
+
| **package_unit** | **String** | Package size unit. | [optional] |
|
17
|
+
|
18
|
+
## Example
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
require 'pnap_billing_api'
|
22
|
+
|
23
|
+
instance = BillingApi::PricingPlan.new(
|
24
|
+
sku: XXX-XXX-XXX,
|
25
|
+
sku_description: Hourly Rate for s1.c1.small in Phoenix,
|
26
|
+
location: PHX,
|
27
|
+
pricing_model: HOURLY,
|
28
|
+
price: 0.22,
|
29
|
+
price_unit: null,
|
30
|
+
applicable_discounts: null,
|
31
|
+
correlated_product_code: s1.c1.small,
|
32
|
+
package_quantity: 50,
|
33
|
+
package_unit: null
|
34
|
+
)
|
35
|
+
```
|
36
|
+
|
data/docs/Product.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# BillingApi::Product
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **product_code** | **String** | The code identifying the product. This code has significant across all locations. | |
|
8
|
+
| **product_category** | **String** | The product category. | |
|
9
|
+
| **plans** | [**Array<PricingPlan>**](PricingPlan.md) | The pricing plans available for this product. | [optional] |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'pnap_billing_api'
|
15
|
+
|
16
|
+
instance = BillingApi::Product.new(
|
17
|
+
product_code: s1.c1.small,
|
18
|
+
product_category: SERVER,
|
19
|
+
plans: null
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|