Querying the APIG Address of a Job
Sample Code
You can use the API to query the APIG access address of a job. Sample code is as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | // Import classes:
import com.huaweicloud.cs.java.v1.client.ApiException;
import com.huaweicloud.cs.java.v1.JobApi;
JobApi apiInstance = new JobApi(apiClient);//apiClient is created when initializing a CS API client.
String xProjectId = "xProjectId_example"; // String | Project ID used for obtaining the token for the project.
Long jobId = 789L; // Long | Job ID.
try {
JobApigSinksResponse result = apiInstance.getApigSinks(xProjectId, jobId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling JobApi#getApigSinks");
System.err.println(e.getResponseBody());
e.printStackTrace();
}
|
Parameter Description
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| xProjectId | Yes | String | Project ID. This parameter is used to obtain the token for the project. |
| jobId | Yes | Integer | Job ID. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| messageId | No | String | Message type ID. |
| message | No | String | Message content. |
| currentTime | No | Integer | Current time, expressed by milliseconds. |
| payload | No | - | For details about parameter types, see Table 3. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| sinks | No | List<JobApigSinkEntity> | For details about parameter types, see Table 4. |
| metadata | No | List<JobMetaDataEntity> | For details about parameter types, see Table 5. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| appId | No | String | ID of the application created on the APIG management console. |
| sinkName | No | String | Name of a sink stream. |
| url | No | String | Address of the API created for accessing APIG. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | No | String | Name of a sink stream. |
| encode | No | String | Format of the sink stream data. |
| delimiter | No | String | Delimiter of the sink stream data. |
| attrs | No | List<JobMetaDataAttrEntity> | Name and type of each field in the sink stream. For details about parameter types, see Table 6. |
Last Article: Querying Job Monitoring Information
Next Article: Collecting Summary Statistics
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.