Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Latest commit

 

History

History
386 lines (278 loc) · 11 KB

GrafeasApi.md

File metadata and controls

386 lines (278 loc) · 11 KB

GrafeasApi

All URIs are relative to http://localhost

Method HTTP request Description
createNote POST /v1alpha1/{parent}/notes Creates a new `Note`.
createOccurrence POST /v1alpha1/{parent}/occurrences Creates a new `Occurrence`. Use this method to create `Occurrences` for a resource.
createOperation POST /v1alpha1/{parent}/operations Creates a new `Operation`.
getOccurrenceNote GET /v1alpha1/{name}/notes Gets the `Note` attached to the given `Occurrence`.
listNoteOccurrences GET /v1alpha1/{name}/occurrences Lists `Occurrences` referencing the specified `Note`. Use this method to get all occurrences referencing your `Note` across all your customer projects.
listNotes GET /v1alpha1/{parent}/notes Lists all `Notes` for a given project.
listOccurrences GET /v1alpha1/{parent}/occurrences Lists active `Occurrences` for a given project matching the filters.
updateNote PATCH /v1alpha1/{name} Updates an existing `Note`.

createNote

ApiNote createNote(parent, body)

Creates a new `Note`.

Example

// Import classes:
//import io.grafeas.ApiException;
//import io.grafeas.api.GrafeasApi;


GrafeasApi apiInstance = new GrafeasApi();
String parent = "parent_example"; // String | 
ApiNote body = new ApiNote(); // ApiNote | 
try {
    ApiNote result = apiInstance.createNote(parent, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GrafeasApi#createNote");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
parent String
body ApiNote

Return type

ApiNote

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createOccurrence

ApiOccurrence createOccurrence(parent, body)

Creates a new `Occurrence`. Use this method to create `Occurrences` for a resource.

Example

// Import classes:
//import io.grafeas.ApiException;
//import io.grafeas.api.GrafeasApi;


GrafeasApi apiInstance = new GrafeasApi();
String parent = "parent_example"; // String | 
ApiOccurrence body = new ApiOccurrence(); // ApiOccurrence | 
try {
    ApiOccurrence result = apiInstance.createOccurrence(parent, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GrafeasApi#createOccurrence");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
parent String
body ApiOccurrence

Return type

ApiOccurrence

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createOperation

LongrunningOperation createOperation(parent, body)

Creates a new `Operation`.

Example

// Import classes:
//import io.grafeas.ApiException;
//import io.grafeas.api.GrafeasApi;


GrafeasApi apiInstance = new GrafeasApi();
String parent = "parent_example"; // String | 
ApiCreateOperationRequest body = new ApiCreateOperationRequest(); // ApiCreateOperationRequest | 
try {
    LongrunningOperation result = apiInstance.createOperation(parent, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GrafeasApi#createOperation");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
parent String
body ApiCreateOperationRequest

Return type

LongrunningOperation

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getOccurrenceNote

ApiNote getOccurrenceNote(name)

Gets the `Note` attached to the given `Occurrence`.

Example

// Import classes:
//import io.grafeas.ApiException;
//import io.grafeas.api.GrafeasApi;


GrafeasApi apiInstance = new GrafeasApi();
String name = "name_example"; // String | 
try {
    ApiNote result = apiInstance.getOccurrenceNote(name);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GrafeasApi#getOccurrenceNote");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
name String

Return type

ApiNote

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

listNoteOccurrences

ApiListNoteOccurrencesResponse listNoteOccurrences(name, filter, pageSize, pageToken)

Lists `Occurrences` referencing the specified `Note`. Use this method to get all occurrences referencing your `Note` across all your customer projects.

Example

// Import classes:
//import io.grafeas.ApiException;
//import io.grafeas.api.GrafeasApi;


GrafeasApi apiInstance = new GrafeasApi();
String name = "name_example"; // String | 
String filter = "filter_example"; // String | The filter expression.
Integer pageSize = 56; // Integer | Number of notes to return in the list.
String pageToken = "pageToken_example"; // String | Token to provide to skip to a particular spot in the list.
try {
    ApiListNoteOccurrencesResponse result = apiInstance.listNoteOccurrences(name, filter, pageSize, pageToken);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GrafeasApi#listNoteOccurrences");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
name String
filter String The filter expression. [optional]
pageSize Integer Number of notes to return in the list. [optional]
pageToken String Token to provide to skip to a particular spot in the list. [optional]

Return type

ApiListNoteOccurrencesResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

listNotes

ApiListNotesResponse listNotes(parent, filter, pageSize, pageToken)

Lists all `Notes` for a given project.

Example

// Import classes:
//import io.grafeas.ApiException;
//import io.grafeas.api.GrafeasApi;


GrafeasApi apiInstance = new GrafeasApi();
String parent = "parent_example"; // String | 
String filter = "filter_example"; // String | The filter expression.
Integer pageSize = 56; // Integer | Number of notes to return in the list.
String pageToken = "pageToken_example"; // String | Token to provide to skip to a particular spot in the list.
try {
    ApiListNotesResponse result = apiInstance.listNotes(parent, filter, pageSize, pageToken);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GrafeasApi#listNotes");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
parent String
filter String The filter expression. [optional]
pageSize Integer Number of notes to return in the list. [optional]
pageToken String Token to provide to skip to a particular spot in the list. [optional]

Return type

ApiListNotesResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

listOccurrences

ApiListOccurrencesResponse listOccurrences(parent, filter, pageSize, pageToken)

Lists active `Occurrences` for a given project matching the filters.

Example

// Import classes:
//import io.grafeas.ApiException;
//import io.grafeas.api.GrafeasApi;


GrafeasApi apiInstance = new GrafeasApi();
String parent = "parent_example"; // String | 
String filter = "filter_example"; // String | The filter expression.
Integer pageSize = 56; // Integer | Number of occurrences to return in the list.
String pageToken = "pageToken_example"; // String | Token to provide to skip to a particular spot in the list.
try {
    ApiListOccurrencesResponse result = apiInstance.listOccurrences(parent, filter, pageSize, pageToken);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GrafeasApi#listOccurrences");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
parent String
filter String The filter expression. [optional]
pageSize Integer Number of occurrences to return in the list. [optional]
pageToken String Token to provide to skip to a particular spot in the list. [optional]

Return type

ApiListOccurrencesResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateNote

ApiNote updateNote(name, body)

Updates an existing `Note`.

Example

// Import classes:
//import io.grafeas.ApiException;
//import io.grafeas.api.GrafeasApi;


GrafeasApi apiInstance = new GrafeasApi();
String name = "name_example"; // String | 
ApiNote body = new ApiNote(); // ApiNote | 
try {
    ApiNote result = apiInstance.updateNote(name, body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling GrafeasApi#updateNote");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
name String
body ApiNote

Return type

ApiNote

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json