Skip to content

Commit 5a6c5ca

Browse files
Release v21.12
1 parent adf99e1 commit 5a6c5ca

6 files changed

Lines changed: 241 additions & 3 deletions
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
---
2+
id: "metered-consumption"
3+
url: "viewer/metered-consumption"
4+
title: "Getting metered license consumption"
5+
productName: "GroupDocs.Viewer Cloud"
6+
description: ""
7+
keywords: ""
8+
---
9+
### Introduction ###
10+
11+
{{< alert style="info" >}}
12+
This example related to Docker version of GroupDocs.Viewer-Cloud only
13+
{{< /alert >}}
14+
15+
The metered license can be used in Docker version of GroupDocs.Viewer-Cloud.
16+
Here is an example how to retrieve metered license consumption.
17+
18+
You can find more information about Docker version at [How to self-host GroupDocs.Viewer Cloud with Docker]({{< ref "viewer/getting-started/how-to-self-host-groupdocs-viewer-cloud-with-docker.md" >}})
19+
20+
## Resource URI ##
21+
22+
```HTTP GET ~/viewer/consumption```
23+
24+
## cURL Example ##
25+
26+
{{< tabs tabTotal="2" tabID="1" tabName1="Request" tabName2="Response" >}} {{< tab tabNum="1" >}}
27+
28+
```html
29+
30+
* cURL example to get metered license consumption
31+
curl -v "http://<base url>/v2.0/viewer/consumption" \
32+
-X GET \
33+
-H "Accept: application/json" \
34+
-H "Authorization: Bearer <jwt token>"
35+
```
36+
37+
{{< /tab >}} {{< tab tabNum="2" >}}
38+
39+
```html
40+
{
41+
"credit": 487848,
42+
"quantity": 6061570985.37938
43+
}
44+
{{< /tab >}} {{< /tabs >}}
45+
46+
## Response ##
47+
48+
The response structure contains metered license consumption information:
49+
50+
| Name | Type | Comment
51+
|---|---|---
52+
|Credit|decimal|Amount of used credits.
53+
|Quantity|decimal|Amount of MBs processed.
54+
55+
## SDKs ##
56+
57+
Our API is completely independent of your operating system, database system or development language. You can use any language and platform that supports HTTP to interact with our API. However, manually writing client code can be difficult, error-prone and time-consuming. Therefore, we have provided and support API [SDKs](https://github.com/groupdocs-viewer-cloud) in many development languages in order to make it easier to integrate with us.
58+
59+
### SDK Examples ###
60+
61+
{{< tabs tabTotal="6" tabID="10" tabName1="C#" tabName2="Java" tabName3="PHP" tabName4="Node.js" tabName5="Python" tabName6="Ruby" >}} {{< tab tabNum="1" >}}
62+
63+
```csharp
64+
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet-samples
65+
string MyClientSecret = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
66+
string MyClientId = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
67+
68+
var configuration = new Configuration(MyClientId, MyClientSecret);
69+
70+
// Create necessary API instances
71+
var apiInstance = new LicenseApi(configuration);
72+
73+
var response = apiInstance.GetConsumptionCredit();
74+
75+
Console.WriteLine($"Credits: {response.Credit}");
76+
Console.WriteLine($"Quantity: {response.Quantity}");
77+
```
78+
79+
{{< /tab >}} {{< tab tabNum="2" >}}
80+
81+
```java
82+
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java-samples
83+
String MyClientSecret = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
84+
String MyClientId = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
85+
86+
Configuration configuration = new Configuration(MyClientId, MyClientSecret);
87+
88+
// Create API instance
89+
LicenseApi apiInstance = new LicenseApi(configuration);
90+
91+
ConsumptionResult response = apiInstance.getConsumptionCredit();
92+
System.out.println("Credit: " + response.getCredit());
93+
System.out.println("Quantity: " + response.getQuantity());
94+
```
95+
96+
{{< /tab >}} {{< tab tabNum="3" >}}
97+
98+
```php
99+
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-php-samples
100+
use GroupDocs\Viewer\Model;
101+
use GroupDocs\Viewer\Model\Requests;
102+
103+
$ClientId = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
104+
$ClientSecret = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
105+
106+
$configuration = new GroupDocs\Viewer\Configuration();
107+
$configuration->setAppSid($ClientId);
108+
$configuration->setAppKey($ClientSecret);
109+
110+
$apiInstance = new GroupDocs\Viewer\LicenseApi($configuration);
111+
112+
// Prepare request
113+
$filePath = dirname(realpath(__DIR__)) . '\Resources\WordProcessing\four-pages.docx';
114+
$request = new Requests\ConvertDocumentDirectRequest("pdf", $filePath);
115+
116+
// Get consumption
117+
$result = $apiInstance->getConsumptionCredit();
118+
119+
// Done
120+
echo "Credit: " . $result->getCredit();
121+
```
122+
123+
{{< /tab >}} {{< tab tabNum="4" >}}
124+
125+
```node
126+
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-node-samples
127+
global.viewer_cloud = require("groupdocs-viewer-cloud");
128+
129+
global.clientId = "XXXX-XXXX-XXXX-XXXX"; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
130+
global.clientSecret = "XXXXXXXXXXXXXXXX"; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
131+
132+
global.licenseApi = viewer_cloud.LicenseApi.fromKeys(clientId, clientSecret);
133+
134+
let response = await licenseApi.getConsumptionCredit();
135+
console.log("GetLicenseConsumption: Credit = " + response.credit);
136+
```
137+
138+
{{< /tab >}} {{< tab tabNum="5" >}}
139+
140+
```python
141+
# For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-python-samples
142+
import groupdocs_viewer_cloud
143+
144+
client_id = "XXXX-XXXX-XXXX-XXXX" # Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
145+
client_secret = "XXXXXXXXXXXXXXXX" # Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
146+
147+
# Create necessary API instances
148+
apiInstance = groupdocs_viewer_cloud.LicenseApi.from_keys(Common.client_id, Common.client_secret)
149+
150+
# Get consumption
151+
result = apiInstance.get_consumption_credit()
152+
153+
print("Credit: " + result.credit)
154+
```
155+
156+
{{< /tab >}} {{< tab tabNum="6" >}}
157+
158+
```ruby
159+
# For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-ruby-samples
160+
require 'groupdocs_viewer_cloud'
161+
162+
$client_id = "XXXX-XXXX-XXXX-XXXX" # Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
163+
$client_secret = "XXXXXXXXXXXXXXXX" # Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
164+
165+
# Create necessary API instances
166+
apiInstance = GroupDocsViewerCloud::LicenseApi.from_keys($client_id, $client_secret)
167+
168+
# Get consumption
169+
result = apiInstance.get_consumption_credit()
170+
171+
puts("Credit: " + result.credit)
172+
```
173+
174+
{{< /tab >}} {{< /tabs >}}

content/viewer/getting-started/how-to-self-host-groupdocs-viewer-cloud-with-docker.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,38 @@ docker run \
149149

150150
{{< /tab >}} {{< /tabs >}}
151151

152+
### Enable Google Cloud Storage
153+
154+
By default, a local storage used inside container for file operations. It's possible to connect a Google Cloud storage by setting GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_STORAGE_BUCKET environment variables.
155+
156+
{{< tabs tabTotal="2" tabID="35" tabName1="Windows (PowerShell)" tabName2="Linux (bash)" >}} {{< tab tabNum="1" >}}
157+
158+
```powershell
159+
docker run `
160+
-p 8080:80 `
161+
-v "${pwd}/fonts:/fonts" `
162+
-v "${pwd}/data:/data" `
163+
-e "GOOGLE_APPLICATION_CREDENTIALS=/data/key.json" `
164+
-e "GOOGLE_STORAGE_BUCKET=bucket_id" `
165+
--name viewer_cloud `
166+
groupdocs/viewer-cloud
167+
```
168+
169+
{{< /tab >}} {{< tab tabNum="2" >}}
170+
171+
```bash
172+
docker run \
173+
-p 8080:80 \
174+
-v $(pwd)/fonts:/fonts \
175+
-v $(pwd)/data:/data \
176+
-e GOOGLE_APPLICATION_CREDENTIALS=/data/key.json \
177+
-e GOOGLE_STORAGE_BUCKET=bucket_id \
178+
--name viewer_cloud \
179+
groupdocs/viewer-cloud
180+
```
181+
182+
{{< /tab >}} {{< /tabs >}}
183+
152184
### Stop Container
153185

154186
To stop the running Docker container, just use Ctrl+C in the same terminal where the container is running. Alternatively, you can stop the container by name.
@@ -165,3 +197,7 @@ GroupDocs.Viewer Cloud can be started in trial and licensed modes. When GroupDoc
165197
* Evaluation watermarks added to the output
166198

167199
You can find more information about evaluation at [Evaluate GroupDocs.Viewer]({{< ref "viewer/getting-started/evaluate-groupdocs-viewer.md" >}}).
200+
201+
## DockerHub
202+
203+
You can find more information at [DockerHub](https://hub.docker.com/repository/docker/groupdocs/viewer-cloud).

content/viewer/release-notes/2021/groupdocs-viewer-cloud-21-10-release-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: "groupdocs-viewer-cloud-21-10-release-notes"
33
url: "viewer/groupdocs-viewer-cloud-21-10-release-notes"
44
title: "GroupDocs.Viewer Cloud 21.10 Release Notes"
55
productName: "GroupDocs.Viewer Cloud"
6-
weight: 1
6+
weight: 2
77
description: ""
88
keywords: ""
99
---
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
id: "groupdocs-viewer-cloud-21-12-release-notes"
3+
url: "viewer/groupdocs-viewer-cloud-21-12-release-notes"
4+
title: "GroupDocs.Viewer Cloud 21.12 Release Notes"
5+
productName: "GroupDocs.Viewer Cloud"
6+
weight: 1
7+
description: ""
8+
keywords: ""
9+
---
10+
11+
This page contains release notes for GroupDocs.Viewer Cloud 21.12
12+
13+
## Major Features ##
14+
15+
+ Added support of Google Cloud Storage
16+
+ Added License API which allows to get metered license consumption information
17+
18+
## Full List of Issues Covering all Changes in this Release ##
19+
20+
|Key|Summary|Category
21+
|---|---|---
22+
|VIEWERCLOUD-436|Add method to get consumption of metered license|Improvement
23+
24+
## Public API and Backward Incompatible Changes ##
25+
26+
[Here is an example how to retrieve metered license consumption]({{< ref "viewer/developer-guide/metered-consumption.md" >}})
27+
28+
You can find more information about Docker version at [How to self-host GroupDocs.Viewer Cloud with Docker]({{< ref "viewer/getting-started/how-to-self-host-groupdocs-viewer-cloud-with-docker.md" >}})

content/viewer/release-notes/2021/groupdocs-viewer-cloud-21-3-release-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: "groupdocs-viewer-cloud-21-3-release-notes"
33
url: "viewer/groupdocs-viewer-cloud-21-3-release-notes"
44
title: "GroupDocs.Viewer Cloud 21.3 Release Notes"
55
productName: "GroupDocs.Viewer Cloud"
6-
weight: 3
6+
weight: 4
77
description: ""
88
keywords: ""
99
---

content/viewer/release-notes/2021/groupdocs-viewer-cloud-21-8-release-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: "groupdocs-viewer-cloud-21-8-release-notes"
33
url: "viewer/groupdocs-viewer-cloud-21-8-release-notes"
44
title: "GroupDocs.Viewer Cloud 21.8 Release Notes"
55
productName: "GroupDocs.Viewer Cloud"
6-
weight: 2
6+
weight: 3
77
description: ""
88
keywords: ""
99
---

0 commit comments

Comments
 (0)