C# client for the ComboCurve REST API
View the Project on GitHub insidepetroleum/combocurve-client-csharp
All URIs are relative to https://api.combocurve.com
| Method | HTTP request | Description |
|---|---|---|
| GetMonthlyExportById | GET /v1/projects/{projectId}/scenarios/{scenarioId}/econ-runs/{econRunId}/monthly-exports/{id} | Returns the econ monthly documents that matches the given monthly export id scoped to projectId project, scenarioId scenario and econRunId econ run, monthly export must be created before. |
| HeadMonthlyExports | HEAD /v1/projects/{projectId}/scenarios/{scenarioId}/econ-runs/{econRunId}/monthly-exports | Returns metadata about the existing econ monthly documents scoped to projectId project, scenarioId scenario and econRunId econ run. |
| PostMonthlyExports | POST /v1/projects/{projectId}/scenarios/{scenarioId}/econ-runs/{econRunId}/monthly-exports | Create an monthly export of econ monthly documents scoped to projectId project, scenarioId scenario and econRunId econ run. Response id should be used to get the results. When the scenario has a facility network, each facility has its own rows. A facility row holds the facility's volumes only, and its well id is the facility's id. |
MonthlyExport GetMonthlyExportById (string projectId, string scenarioId, string econRunId, string id, int? skip = null, int? take = null, int? concurrency = null)
Returns the econ monthly documents that matches the given monthly export id scoped to projectId project, scenarioId scenario and econRunId econ run, monthly export must be created before.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using ComboCurve.Api.Api;
using ComboCurve.Api.Auth;
using ComboCurve.Api.Client;
using ComboCurve.Api.Model;
namespace Example
{
public class GetMonthlyExportByIdExample
{
public static void Main()
{
// Use this to create your service account manually
var serviceAccount = new ServiceAccount
{
ClientEmail = "YOUR_CLIENT_EMAIL",
ClientId = "YOUR_CLIENT_ID",
PrivateKey = "YOUR_PRIVATE_KEY"
};
// Or use this to load it from a JSON file
// var serviceAccount = ServiceAccount.FromFile("PATH_TO_JSON_FILE");
// Set your API key
var apiKey = "YOUR_API_KEY";
var apiInstance = new ComboCurveV1Api(serviceAccount, apiKey);
// Or use the specific API class (Recommended)
// var apiInstance = new MonthlyExportApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var scenarioId = "scenarioId_example"; // string |
var econRunId = "econRunId_example"; // string |
var id = "id_example"; // string |
var skip = 56; // int? | number of items to skip. Cannot be combined with `cursor`; sending both returns 400. (optional) (default to 0)
var take = 56; // int? | max records to return (optional) (default to 100) (between 1 and 2000)
var concurrency = 56; // int? | maximum number of concurrent requests to make to the underlying datastore (optional) (default to 0) (between 1 and 10)
try
{
// Returns the econ monthly documents that matches the given monthly export id scoped to projectId project, scenarioId scenario and econRunId econ run, monthly export must be created before.
MonthlyExport result = apiInstance.GetMonthlyExportById(projectId, scenarioId, econRunId, id, skip, take, concurrency);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling MonthlyExportApi.GetMonthlyExportById: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | string | ||
| scenarioId | string | ||
| econRunId | string | ||
| id | string | ||
| skip | int? | number of items to skip. Cannot be combined with `cursor`; sending both returns 400. | [optional] [default to 0] |
| take | int? | max records to return | [optional] [default to 100] [between 1 and 2000] |
| concurrency | int? | maximum number of concurrent requests to make to the underlying datastore | [optional] [default to 0] [between 1 and 10] |
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 200 | OK | * Link - Pagination links in the RFC 8288 `Link` header: `next` (when more results remain), `prev` (not on the first page) and `first`. `last` is never returned. | | 400 | Bad Request. There is something wrong with the request data. | - | | 404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void HeadMonthlyExports (string projectId, string scenarioId, string econRunId, int? skip = null, int? take = null, string comboName = null, DateTimeOffset? date = null, string well = null)
Returns metadata about the existing econ monthly documents scoped to projectId project, scenarioId scenario and econRunId econ run.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using ComboCurve.Api.Api;
using ComboCurve.Api.Auth;
using ComboCurve.Api.Client;
using ComboCurve.Api.Model;
namespace Example
{
public class HeadMonthlyExportsExample
{
public static void Main()
{
// Use this to create your service account manually
var serviceAccount = new ServiceAccount
{
ClientEmail = "YOUR_CLIENT_EMAIL",
ClientId = "YOUR_CLIENT_ID",
PrivateKey = "YOUR_PRIVATE_KEY"
};
// Or use this to load it from a JSON file
// var serviceAccount = ServiceAccount.FromFile("PATH_TO_JSON_FILE");
// Set your API key
var apiKey = "YOUR_API_KEY";
var apiInstance = new ComboCurveV1Api(serviceAccount, apiKey);
// Or use the specific API class (Recommended)
// var apiInstance = new MonthlyExportApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var scenarioId = "scenarioId_example"; // string |
var econRunId = "econRunId_example"; // string |
var skip = 56; // int? | number of items to skip. Cannot be combined with `cursor`; sending both returns 400. (optional) (default to 0)
var take = 56; // int? | max records to return (optional) (default to 100) (between 1 and 2000)
var comboName = "comboName_example"; // string | filter by comboName (optional)
var date = DateTimeOffset.Parse("2013-10-20"); // DateTimeOffset? | filter by date (optional)
var well = "well_example"; // string | filter by well (optional)
try
{
// Returns metadata about the existing econ monthly documents scoped to projectId project, scenarioId scenario and econRunId econ run.
apiInstance.HeadMonthlyExports(projectId, scenarioId, econRunId, skip, take, comboName, date, well);
}
catch (ApiException e)
{
Debug.Print("Exception when calling MonthlyExportApi.HeadMonthlyExports: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | string | ||
| scenarioId | string | ||
| econRunId | string | ||
| skip | int? | number of items to skip. Cannot be combined with `cursor`; sending both returns 400. | [optional] [default to 0] |
| take | int? | max records to return | [optional] [default to 100] [between 1 and 2000] |
| comboName | string | filter by comboName | [optional] |
| date | DateTimeOffset? | filter by date | [optional] |
| well | string | filter by well | [optional] |
void (empty response body)
API Key, Service Account
| Status code | Description | Response headers |
|————-|————-|——————|
| 200 | OK | * X-Query-Count - The number of records in this resource. When filters are provided only matching records are counted.
* Link - Pagination links in the RFC 8288 `Link` header: `next` (when more results remain), `prev` (not on the first page) and `first`. `last` is never returned. |
| 400 | Bad Request. There is something wrong with the request data. | - |
| 409 | Conflict. The econ run was created before econ results were stored as parquet files, so its results are not available. Re-run the scenario and use the new econ run. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MonthlyExportJob PostMonthlyExports (string projectId, string scenarioId, string econRunId, string comboName = null, DateTimeOffset? date = null, string well = null)
Create an monthly export of econ monthly documents scoped to projectId project, scenarioId scenario and econRunId econ run. Response id should be used to get the results. When the scenario has a facility network, each facility has its own rows. A facility row holds the facility’s volumes only, and its well id is the facility’s id.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using ComboCurve.Api.Api;
using ComboCurve.Api.Auth;
using ComboCurve.Api.Client;
using ComboCurve.Api.Model;
namespace Example
{
public class PostMonthlyExportsExample
{
public static void Main()
{
// Use this to create your service account manually
var serviceAccount = new ServiceAccount
{
ClientEmail = "YOUR_CLIENT_EMAIL",
ClientId = "YOUR_CLIENT_ID",
PrivateKey = "YOUR_PRIVATE_KEY"
};
// Or use this to load it from a JSON file
// var serviceAccount = ServiceAccount.FromFile("PATH_TO_JSON_FILE");
// Set your API key
var apiKey = "YOUR_API_KEY";
var apiInstance = new ComboCurveV1Api(serviceAccount, apiKey);
// Or use the specific API class (Recommended)
// var apiInstance = new MonthlyExportApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var scenarioId = "scenarioId_example"; // string |
var econRunId = "econRunId_example"; // string |
var comboName = "comboName_example"; // string | filter by comboName (optional)
var date = DateTimeOffset.Parse("2013-10-20"); // DateTimeOffset? | filter by date (optional)
var well = "well_example"; // string | filter by well (optional)
try
{
// Create an monthly export of econ monthly documents scoped to projectId project, scenarioId scenario and econRunId econ run. Response id should be used to get the results. When the scenario has a facility network, each facility has its own rows. A facility row holds the facility's volumes only, and its well id is the facility's id.
MonthlyExportJob result = apiInstance.PostMonthlyExports(projectId, scenarioId, econRunId, comboName, date, well);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling MonthlyExportApi.PostMonthlyExports: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | string | ||
| scenarioId | string | ||
| econRunId | string | ||
| comboName | string | filter by comboName | [optional] |
| date | DateTimeOffset? | filter by date | [optional] |
| well | string | filter by well | [optional] |
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 200 | OK | - | | 400 | Bad Request. There is something wrong with the request data. | - | | 409 | Conflict. The econ run was created before econ results were stored as parquet files, so its results are not available. Re-run the scenario and use the new econ run. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]