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

Latest commit

 

History

History
174 lines (122 loc) · 7.23 KB

SearchApi.md

File metadata and controls

174 lines (122 loc) · 7.23 KB

\SearchApi

All URIs are relative to http://127.0.0.1:4646/v1

Method HTTP request Description
GetFuzzySearch Post /search/fuzzy
GetSearch Post /search

GetFuzzySearch

FuzzySearchResponse GetFuzzySearch(ctx).FuzzySearchRequest(fuzzySearchRequest).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute()

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    fuzzySearchRequest := *openapiclient.NewFuzzySearchRequest() // FuzzySearchRequest | 
    region := "region_example" // string | Filters results based on the specified region. (optional)
    namespace := "namespace_example" // string | Filters results based on the specified namespace. (optional)
    index := int32(56) // int32 | If set, wait until query exceeds given index. Must be provided with WaitParam. (optional)
    wait := "wait_example" // string | Provided with IndexParam to wait for change. (optional)
    stale := "stale_example" // string | If present, results will include stale reads. (optional)
    prefix := "prefix_example" // string | Constrains results to jobs that start with the defined prefix (optional)
    xNomadToken := "xNomadToken_example" // string | A Nomad ACL token. (optional)
    perPage := int32(56) // int32 | Maximum number of results to return. (optional)
    nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.SearchApi.GetFuzzySearch(context.Background()).FuzzySearchRequest(fuzzySearchRequest).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `SearchApi.GetFuzzySearch``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetFuzzySearch`: FuzzySearchResponse
    fmt.Fprintf(os.Stdout, "Response from `SearchApi.GetFuzzySearch`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetFuzzySearchRequest struct via the builder pattern

Name Type Description Notes
fuzzySearchRequest FuzzySearchRequest
region string Filters results based on the specified region.
namespace string Filters results based on the specified namespace.
index int32 If set, wait until query exceeds given index. Must be provided with WaitParam.
wait string Provided with IndexParam to wait for change.
stale string If present, results will include stale reads.
prefix string Constrains results to jobs that start with the defined prefix
xNomadToken string A Nomad ACL token.
perPage int32 Maximum number of results to return.
nextToken string Indicates where to start paging for queries that support pagination.

Return type

FuzzySearchResponse

Authorization

X-Nomad-Token

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetSearch

SearchResponse GetSearch(ctx).SearchRequest(searchRequest).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute()

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    searchRequest := *openapiclient.NewSearchRequest() // SearchRequest | 
    region := "region_example" // string | Filters results based on the specified region. (optional)
    namespace := "namespace_example" // string | Filters results based on the specified namespace. (optional)
    index := int32(56) // int32 | If set, wait until query exceeds given index. Must be provided with WaitParam. (optional)
    wait := "wait_example" // string | Provided with IndexParam to wait for change. (optional)
    stale := "stale_example" // string | If present, results will include stale reads. (optional)
    prefix := "prefix_example" // string | Constrains results to jobs that start with the defined prefix (optional)
    xNomadToken := "xNomadToken_example" // string | A Nomad ACL token. (optional)
    perPage := int32(56) // int32 | Maximum number of results to return. (optional)
    nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.SearchApi.GetSearch(context.Background()).SearchRequest(searchRequest).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `SearchApi.GetSearch``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetSearch`: SearchResponse
    fmt.Fprintf(os.Stdout, "Response from `SearchApi.GetSearch`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetSearchRequest struct via the builder pattern

Name Type Description Notes
searchRequest SearchRequest
region string Filters results based on the specified region.
namespace string Filters results based on the specified namespace.
index int32 If set, wait until query exceeds given index. Must be provided with WaitParam.
wait string Provided with IndexParam to wait for change.
stale string If present, results will include stale reads.
prefix string Constrains results to jobs that start with the defined prefix
xNomadToken string A Nomad ACL token.
perPage int32 Maximum number of results to return.
nextToken string Indicates where to start paging for queries that support pagination.

Return type

SearchResponse

Authorization

X-Nomad-Token

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]