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
@@ -0,0 +1,22 @@
|
|
1
|
+
# BillingApi::ProductAvailability
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **product_code** | **String** | Product code. | |
|
8
|
+
| **product_category** | **String** | Product category. | |
|
9
|
+
| **location_availability_details** | [**Array<LocationAvailabilityDetail>**](LocationAvailabilityDetail.md) | | |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'pnap_billing_api'
|
15
|
+
|
16
|
+
instance = BillingApi::ProductAvailability.new(
|
17
|
+
product_code: d1.c1.small,
|
18
|
+
product_category: SERVER,
|
19
|
+
location_availability_details: null
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# BillingApi::ProductCategoryEnum
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
|
8
|
+
## Example
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'pnap_billing_api'
|
12
|
+
|
13
|
+
instance = BillingApi::ProductCategoryEnum.new()
|
14
|
+
```
|
15
|
+
|
data/docs/ProductsApi.md
ADDED
@@ -0,0 +1,167 @@
|
|
1
|
+
# BillingApi::ProductsApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://api.phoenixnap.com/billing/v1*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**product_availability_get**](ProductsApi.md#product_availability_get) | **GET** /product-availability | List all Product availabilities. |
|
8
|
+
| [**products_get**](ProductsApi.md#products_get) | **GET** /products | List all Products. |
|
9
|
+
|
10
|
+
|
11
|
+
## product_availability_get
|
12
|
+
|
13
|
+
> <Array<ProductAvailability>> product_availability_get(opts)
|
14
|
+
|
15
|
+
List all Product availabilities.
|
16
|
+
|
17
|
+
Retrieves the list of product availability details.
|
18
|
+
|
19
|
+
### Examples
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
require 'time'
|
23
|
+
require 'pnap_billing_api'
|
24
|
+
# setup authorization
|
25
|
+
BillingApi.configure do |config|
|
26
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
27
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
28
|
+
end
|
29
|
+
|
30
|
+
api_instance = BillingApi::ProductsApi.new
|
31
|
+
opts = {
|
32
|
+
product_category: ['SERVER'], # Array<String> | Product category. Currently only SERVER category is supported.
|
33
|
+
product_code: ['inner_example'], # Array<String> |
|
34
|
+
show_only_min_quantity_available: true, # Boolean | Show only locations where product with requested quantity is available or all locations where product is offered.
|
35
|
+
location: [BillingApi::LocationEnum::PHX], # Array<LocationEnum> |
|
36
|
+
solution: ['SERVER_RANCHER'], # Array<String> |
|
37
|
+
min_quantity: 2 # Float | Minimal quantity of product needed. Minimum, maximum and default values might differ for different products. For servers, they are 1, 10 and 1 respectively.
|
38
|
+
}
|
39
|
+
|
40
|
+
begin
|
41
|
+
# List all Product availabilities.
|
42
|
+
result = api_instance.product_availability_get(opts)
|
43
|
+
p result
|
44
|
+
rescue BillingApi::ApiError => e
|
45
|
+
puts "Error when calling ProductsApi->product_availability_get: #{e}"
|
46
|
+
end
|
47
|
+
```
|
48
|
+
|
49
|
+
#### Using the product_availability_get_with_http_info variant
|
50
|
+
|
51
|
+
This returns an Array which contains the response data, status code and headers.
|
52
|
+
|
53
|
+
> <Array(<Array<ProductAvailability>>, Integer, Hash)> product_availability_get_with_http_info(opts)
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
begin
|
57
|
+
# List all Product availabilities.
|
58
|
+
data, status_code, headers = api_instance.product_availability_get_with_http_info(opts)
|
59
|
+
p status_code # => 2xx
|
60
|
+
p headers # => { ... }
|
61
|
+
p data # => <Array<ProductAvailability>>
|
62
|
+
rescue BillingApi::ApiError => e
|
63
|
+
puts "Error when calling ProductsApi->product_availability_get_with_http_info: #{e}"
|
64
|
+
end
|
65
|
+
```
|
66
|
+
|
67
|
+
### Parameters
|
68
|
+
|
69
|
+
| Name | Type | Description | Notes |
|
70
|
+
| ---- | ---- | ----------- | ----- |
|
71
|
+
| **product_category** | [**Array<String>**](String.md) | Product category. Currently only SERVER category is supported. | [optional] |
|
72
|
+
| **product_code** | [**Array<String>**](String.md) | | [optional] |
|
73
|
+
| **show_only_min_quantity_available** | **Boolean** | Show only locations where product with requested quantity is available or all locations where product is offered. | [optional][default to true] |
|
74
|
+
| **location** | [**Array<LocationEnum>**](LocationEnum.md) | | [optional] |
|
75
|
+
| **solution** | [**Array<String>**](String.md) | | [optional] |
|
76
|
+
| **min_quantity** | **Float** | Minimal quantity of product needed. Minimum, maximum and default values might differ for different products. For servers, they are 1, 10 and 1 respectively. | [optional] |
|
77
|
+
|
78
|
+
### Return type
|
79
|
+
|
80
|
+
[**Array<ProductAvailability>**](ProductAvailability.md)
|
81
|
+
|
82
|
+
### Authorization
|
83
|
+
|
84
|
+
[OAuth2](../README.md#OAuth2)
|
85
|
+
|
86
|
+
### HTTP request headers
|
87
|
+
|
88
|
+
- **Content-Type**: Not defined
|
89
|
+
- **Accept**: application/json
|
90
|
+
|
91
|
+
|
92
|
+
## products_get
|
93
|
+
|
94
|
+
> <Array<ProductsGet200ResponseInner>> products_get(opts)
|
95
|
+
|
96
|
+
List all Products.
|
97
|
+
|
98
|
+
Retrieves all Products.
|
99
|
+
|
100
|
+
### Examples
|
101
|
+
|
102
|
+
```ruby
|
103
|
+
require 'time'
|
104
|
+
require 'pnap_billing_api'
|
105
|
+
# setup authorization
|
106
|
+
BillingApi.configure do |config|
|
107
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
108
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
109
|
+
end
|
110
|
+
|
111
|
+
api_instance = BillingApi::ProductsApi.new
|
112
|
+
opts = {
|
113
|
+
product_code: 's1.c1.small', # String |
|
114
|
+
product_category: 'SERVER', # String |
|
115
|
+
sku_code: 'xxx-xxx-xxx', # String |
|
116
|
+
location: 'PHX' # String |
|
117
|
+
}
|
118
|
+
|
119
|
+
begin
|
120
|
+
# List all Products.
|
121
|
+
result = api_instance.products_get(opts)
|
122
|
+
p result
|
123
|
+
rescue BillingApi::ApiError => e
|
124
|
+
puts "Error when calling ProductsApi->products_get: #{e}"
|
125
|
+
end
|
126
|
+
```
|
127
|
+
|
128
|
+
#### Using the products_get_with_http_info variant
|
129
|
+
|
130
|
+
This returns an Array which contains the response data, status code and headers.
|
131
|
+
|
132
|
+
> <Array(<Array<ProductsGet200ResponseInner>>, Integer, Hash)> products_get_with_http_info(opts)
|
133
|
+
|
134
|
+
```ruby
|
135
|
+
begin
|
136
|
+
# List all Products.
|
137
|
+
data, status_code, headers = api_instance.products_get_with_http_info(opts)
|
138
|
+
p status_code # => 2xx
|
139
|
+
p headers # => { ... }
|
140
|
+
p data # => <Array<ProductsGet200ResponseInner>>
|
141
|
+
rescue BillingApi::ApiError => e
|
142
|
+
puts "Error when calling ProductsApi->products_get_with_http_info: #{e}"
|
143
|
+
end
|
144
|
+
```
|
145
|
+
|
146
|
+
### Parameters
|
147
|
+
|
148
|
+
| Name | Type | Description | Notes |
|
149
|
+
| ---- | ---- | ----------- | ----- |
|
150
|
+
| **product_code** | **String** | | [optional] |
|
151
|
+
| **product_category** | **String** | | [optional] |
|
152
|
+
| **sku_code** | **String** | | [optional] |
|
153
|
+
| **location** | **String** | | [optional] |
|
154
|
+
|
155
|
+
### Return type
|
156
|
+
|
157
|
+
[**Array<ProductsGet200ResponseInner>**](ProductsGet200ResponseInner.md)
|
158
|
+
|
159
|
+
### Authorization
|
160
|
+
|
161
|
+
[OAuth2](../README.md#OAuth2)
|
162
|
+
|
163
|
+
### HTTP request headers
|
164
|
+
|
165
|
+
- **Content-Type**: Not defined
|
166
|
+
- **Accept**: application/json
|
167
|
+
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# BillingApi::ProductsGet200ResponseInner
|
2
|
+
|
3
|
+
## Class instance methods
|
4
|
+
|
5
|
+
### `openapi_one_of`
|
6
|
+
|
7
|
+
Returns the list of classes defined in oneOf.
|
8
|
+
|
9
|
+
#### Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'pnap_billing_api'
|
13
|
+
|
14
|
+
BillingApi::ProductsGet200ResponseInner.openapi_one_of
|
15
|
+
# =>
|
16
|
+
# [
|
17
|
+
# :'Product',
|
18
|
+
# :'ServerProduct'
|
19
|
+
# ]
|
20
|
+
```
|
21
|
+
|
22
|
+
### `openapi_discriminator_name`
|
23
|
+
|
24
|
+
Returns the discriminator's property name.
|
25
|
+
|
26
|
+
#### Example
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
require 'pnap_billing_api'
|
30
|
+
|
31
|
+
BillingApi::ProductsGet200ResponseInner.openapi_discriminator_name
|
32
|
+
# => :'product_category'
|
33
|
+
```
|
34
|
+
|
35
|
+
### `openapi_discriminator_name`
|
36
|
+
|
37
|
+
Returns the discriminator's mapping.
|
38
|
+
|
39
|
+
#### Example
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
require 'pnap_billing_api'
|
43
|
+
|
44
|
+
BillingApi::ProductsGet200ResponseInner.openapi_discriminator_mapping
|
45
|
+
# =>
|
46
|
+
# {
|
47
|
+
# :'BANDWIDTH' => :'Product',
|
48
|
+
# :'OPERATING_SYSTEM' => :'Product',
|
49
|
+
# :'PUBLIC_IP' => :'Product',
|
50
|
+
# :'SERVER' => :'ServerProduct',
|
51
|
+
# :'STORAGE' => :'Product'
|
52
|
+
# }
|
53
|
+
```
|
54
|
+
|
55
|
+
### build
|
56
|
+
|
57
|
+
Find the appropriate object from the `openapi_one_of` list and casts the data into it.
|
58
|
+
|
59
|
+
#### Example
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
require 'pnap_billing_api'
|
63
|
+
|
64
|
+
BillingApi::ProductsGet200ResponseInner.build(data)
|
65
|
+
# => #<Product:0x00007fdd4aab02a0>
|
66
|
+
|
67
|
+
BillingApi::ProductsGet200ResponseInner.build(data_that_doesnt_match)
|
68
|
+
# => nil
|
69
|
+
```
|
70
|
+
|
71
|
+
#### Parameters
|
72
|
+
|
73
|
+
| Name | Type | Description |
|
74
|
+
| ---- | ---- | ----------- |
|
75
|
+
| **data** | **Mixed** | data to be matched against the list of oneOf items |
|
76
|
+
|
77
|
+
#### Return type
|
78
|
+
|
79
|
+
- `Product`
|
80
|
+
- `ServerProduct`
|
81
|
+
- `nil` (if no type matches)
|
82
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# BillingApi::PublicSubnetDetails
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **String** | Public Subnet identifier as returned by the BMC API. | [optional] |
|
8
|
+
| **cidr** | **String** | Classless Inter-Domain Routing | |
|
9
|
+
| **size** | **String** | CIDR size | |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'pnap_billing_api'
|
15
|
+
|
16
|
+
instance = BillingApi::PublicSubnetDetails.new(
|
17
|
+
id: 83604275-bdba-490a-b87a-978e8dffdb14,
|
18
|
+
cidr: 192.168.0.15/24,
|
19
|
+
size: /24
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# BillingApi::PublicSubnetRecord
|
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** | [**PublicSubnetDetails**](PublicSubnetDetails.md) | | |
|
27
|
+
|
28
|
+
## Example
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
require 'pnap_billing_api'
|
32
|
+
|
33
|
+
instance = BillingApi::PublicSubnetRecord.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,155 @@
|
|
1
|
+
# BillingApi::RatedUsageApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://api.phoenixnap.com/billing/v1*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**rated_usage_get**](RatedUsageApi.md#rated_usage_get) | **GET** /rated-usage | List the rated usage. |
|
8
|
+
| [**rated_usage_month_to_date_get**](RatedUsageApi.md#rated_usage_month_to_date_get) | **GET** /rated-usage/month-to-date | List the rated usage records for the current calendar month. |
|
9
|
+
|
10
|
+
|
11
|
+
## rated_usage_get
|
12
|
+
|
13
|
+
> <Array<RatedUsageGet200ResponseInner>> rated_usage_get(from_year_month, to_year_month, opts)
|
14
|
+
|
15
|
+
List the rated usage.
|
16
|
+
|
17
|
+
Retrieves all rated usage for given time period. The information is presented as a list of rated usage records. Every record corresponds to a charge. All date & times are in UTC.
|
18
|
+
|
19
|
+
### Examples
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
require 'time'
|
23
|
+
require 'pnap_billing_api'
|
24
|
+
# setup authorization
|
25
|
+
BillingApi.configure do |config|
|
26
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
27
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
28
|
+
end
|
29
|
+
|
30
|
+
api_instance = BillingApi::RatedUsageApi.new
|
31
|
+
from_year_month = '2020-03' # String | From year month (inclusive) to filter rated usage records by.
|
32
|
+
to_year_month = '2020-04' # String | To year month (inclusive) to filter rated usage records by.
|
33
|
+
opts = {
|
34
|
+
product_category: BillingApi::ProductCategoryEnum::SERVER # ProductCategoryEnum | The product category
|
35
|
+
}
|
36
|
+
|
37
|
+
begin
|
38
|
+
# List the rated usage.
|
39
|
+
result = api_instance.rated_usage_get(from_year_month, to_year_month, opts)
|
40
|
+
p result
|
41
|
+
rescue BillingApi::ApiError => e
|
42
|
+
puts "Error when calling RatedUsageApi->rated_usage_get: #{e}"
|
43
|
+
end
|
44
|
+
```
|
45
|
+
|
46
|
+
#### Using the rated_usage_get_with_http_info variant
|
47
|
+
|
48
|
+
This returns an Array which contains the response data, status code and headers.
|
49
|
+
|
50
|
+
> <Array(<Array<RatedUsageGet200ResponseInner>>, Integer, Hash)> rated_usage_get_with_http_info(from_year_month, to_year_month, opts)
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
begin
|
54
|
+
# List the rated usage.
|
55
|
+
data, status_code, headers = api_instance.rated_usage_get_with_http_info(from_year_month, to_year_month, opts)
|
56
|
+
p status_code # => 2xx
|
57
|
+
p headers # => { ... }
|
58
|
+
p data # => <Array<RatedUsageGet200ResponseInner>>
|
59
|
+
rescue BillingApi::ApiError => e
|
60
|
+
puts "Error when calling RatedUsageApi->rated_usage_get_with_http_info: #{e}"
|
61
|
+
end
|
62
|
+
```
|
63
|
+
|
64
|
+
### Parameters
|
65
|
+
|
66
|
+
| Name | Type | Description | Notes |
|
67
|
+
| ---- | ---- | ----------- | ----- |
|
68
|
+
| **from_year_month** | **String** | From year month (inclusive) to filter rated usage records by. | |
|
69
|
+
| **to_year_month** | **String** | To year month (inclusive) to filter rated usage records by. | |
|
70
|
+
| **product_category** | [**ProductCategoryEnum**](.md) | The product category | [optional] |
|
71
|
+
|
72
|
+
### Return type
|
73
|
+
|
74
|
+
[**Array<RatedUsageGet200ResponseInner>**](RatedUsageGet200ResponseInner.md)
|
75
|
+
|
76
|
+
### Authorization
|
77
|
+
|
78
|
+
[OAuth2](../README.md#OAuth2)
|
79
|
+
|
80
|
+
### HTTP request headers
|
81
|
+
|
82
|
+
- **Content-Type**: Not defined
|
83
|
+
- **Accept**: application/json
|
84
|
+
|
85
|
+
|
86
|
+
## rated_usage_month_to_date_get
|
87
|
+
|
88
|
+
> <Array<RatedUsageGet200ResponseInner>> rated_usage_month_to_date_get(opts)
|
89
|
+
|
90
|
+
List the rated usage records for the current calendar month.
|
91
|
+
|
92
|
+
Retrieves all rated usage for the current calendar month. The information is presented as a list of rated usage records. Every record corresponds to a charge. All date & times are in UTC.
|
93
|
+
|
94
|
+
### Examples
|
95
|
+
|
96
|
+
```ruby
|
97
|
+
require 'time'
|
98
|
+
require 'pnap_billing_api'
|
99
|
+
# setup authorization
|
100
|
+
BillingApi.configure do |config|
|
101
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
102
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
103
|
+
end
|
104
|
+
|
105
|
+
api_instance = BillingApi::RatedUsageApi.new
|
106
|
+
opts = {
|
107
|
+
product_category: BillingApi::ProductCategoryEnum::SERVER # ProductCategoryEnum | The product category
|
108
|
+
}
|
109
|
+
|
110
|
+
begin
|
111
|
+
# List the rated usage records for the current calendar month.
|
112
|
+
result = api_instance.rated_usage_month_to_date_get(opts)
|
113
|
+
p result
|
114
|
+
rescue BillingApi::ApiError => e
|
115
|
+
puts "Error when calling RatedUsageApi->rated_usage_month_to_date_get: #{e}"
|
116
|
+
end
|
117
|
+
```
|
118
|
+
|
119
|
+
#### Using the rated_usage_month_to_date_get_with_http_info variant
|
120
|
+
|
121
|
+
This returns an Array which contains the response data, status code and headers.
|
122
|
+
|
123
|
+
> <Array(<Array<RatedUsageGet200ResponseInner>>, Integer, Hash)> rated_usage_month_to_date_get_with_http_info(opts)
|
124
|
+
|
125
|
+
```ruby
|
126
|
+
begin
|
127
|
+
# List the rated usage records for the current calendar month.
|
128
|
+
data, status_code, headers = api_instance.rated_usage_month_to_date_get_with_http_info(opts)
|
129
|
+
p status_code # => 2xx
|
130
|
+
p headers # => { ... }
|
131
|
+
p data # => <Array<RatedUsageGet200ResponseInner>>
|
132
|
+
rescue BillingApi::ApiError => e
|
133
|
+
puts "Error when calling RatedUsageApi->rated_usage_month_to_date_get_with_http_info: #{e}"
|
134
|
+
end
|
135
|
+
```
|
136
|
+
|
137
|
+
### Parameters
|
138
|
+
|
139
|
+
| Name | Type | Description | Notes |
|
140
|
+
| ---- | ---- | ----------- | ----- |
|
141
|
+
| **product_category** | [**ProductCategoryEnum**](.md) | The product category | [optional] |
|
142
|
+
|
143
|
+
### Return type
|
144
|
+
|
145
|
+
[**Array<RatedUsageGet200ResponseInner>**](RatedUsageGet200ResponseInner.md)
|
146
|
+
|
147
|
+
### Authorization
|
148
|
+
|
149
|
+
[OAuth2](../README.md#OAuth2)
|
150
|
+
|
151
|
+
### HTTP request headers
|
152
|
+
|
153
|
+
- **Content-Type**: Not defined
|
154
|
+
- **Accept**: application/json
|
155
|
+
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# BillingApi::RatedUsageGet200ResponseInner
|
2
|
+
|
3
|
+
## Class instance methods
|
4
|
+
|
5
|
+
### `openapi_one_of`
|
6
|
+
|
7
|
+
Returns the list of classes defined in oneOf.
|
8
|
+
|
9
|
+
#### Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'pnap_billing_api'
|
13
|
+
|
14
|
+
BillingApi::RatedUsageGet200ResponseInner.openapi_one_of
|
15
|
+
# =>
|
16
|
+
# [
|
17
|
+
# :'BandwidthRecord',
|
18
|
+
# :'OperatingSystemRecord',
|
19
|
+
# :'PublicSubnetRecord',
|
20
|
+
# :'ServerRecord',
|
21
|
+
# :'StorageRecord'
|
22
|
+
# ]
|
23
|
+
```
|
24
|
+
|
25
|
+
### `openapi_discriminator_name`
|
26
|
+
|
27
|
+
Returns the discriminator's property name.
|
28
|
+
|
29
|
+
#### Example
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
require 'pnap_billing_api'
|
33
|
+
|
34
|
+
BillingApi::RatedUsageGet200ResponseInner.openapi_discriminator_name
|
35
|
+
# => :'product_category'
|
36
|
+
```
|
37
|
+
|
38
|
+
### `openapi_discriminator_name`
|
39
|
+
|
40
|
+
Returns the discriminator's mapping.
|
41
|
+
|
42
|
+
#### Example
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
require 'pnap_billing_api'
|
46
|
+
|
47
|
+
BillingApi::RatedUsageGet200ResponseInner.openapi_discriminator_mapping
|
48
|
+
# =>
|
49
|
+
# {
|
50
|
+
# :'bandwidth' => :'BandwidthRecord',
|
51
|
+
# :'bmc-server' => :'ServerRecord',
|
52
|
+
# :'operating-system' => :'OperatingSystemRecord',
|
53
|
+
# :'public-ip' => :'PublicSubnetRecord',
|
54
|
+
# :'storage' => :'StorageRecord'
|
55
|
+
# }
|
56
|
+
```
|
57
|
+
|
58
|
+
### build
|
59
|
+
|
60
|
+
Find the appropriate object from the `openapi_one_of` list and casts the data into it.
|
61
|
+
|
62
|
+
#### Example
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
require 'pnap_billing_api'
|
66
|
+
|
67
|
+
BillingApi::RatedUsageGet200ResponseInner.build(data)
|
68
|
+
# => #<BandwidthRecord:0x00007fdd4aab02a0>
|
69
|
+
|
70
|
+
BillingApi::RatedUsageGet200ResponseInner.build(data_that_doesnt_match)
|
71
|
+
# => nil
|
72
|
+
```
|
73
|
+
|
74
|
+
#### Parameters
|
75
|
+
|
76
|
+
| Name | Type | Description |
|
77
|
+
| ---- | ---- | ----------- |
|
78
|
+
| **data** | **Mixed** | data to be matched against the list of oneOf items |
|
79
|
+
|
80
|
+
#### Return type
|
81
|
+
|
82
|
+
- `BandwidthRecord`
|
83
|
+
- `OperatingSystemRecord`
|
84
|
+
- `PublicSubnetRecord`
|
85
|
+
- `ServerRecord`
|
86
|
+
- `StorageRecord`
|
87
|
+
- `nil` (if no type matches)
|
88
|
+
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# BillingApi::RatedUsageRecord
|
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
|
+
|
27
|
+
## Example
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
require 'pnap_billing_api'
|
31
|
+
|
32
|
+
instance = BillingApi::RatedUsageRecord.new(
|
33
|
+
id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
|
34
|
+
product_category: bmc-server,
|
35
|
+
product_code: s1.c1.small,
|
36
|
+
location: null,
|
37
|
+
year_month: 2020-03,
|
38
|
+
start_date_time: 2020-03-19T16:39Z,
|
39
|
+
end_date_time: 2020-03-20T17:00Z,
|
40
|
+
cost: 384,
|
41
|
+
cost_before_discount: 15456,
|
42
|
+
cost_description: 24 Hour(s) @ $0.16 /Hour,
|
43
|
+
price_model: hourly,
|
44
|
+
unit_price: 0.16,
|
45
|
+
unit_price_description: per hour,
|
46
|
+
quantity: 24,
|
47
|
+
active: true,
|
48
|
+
usage_session_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
|
49
|
+
correlation_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
|
50
|
+
reservation_id: c32a24a1-5949-4b60-99c0-c8aaa3a92b04,
|
51
|
+
discount_details: null
|
52
|
+
)
|
53
|
+
```
|
54
|
+
|