Skip to content

Latest commit

 

History

History
124 lines (95 loc) · 7.14 KB

README.md

File metadata and controls

124 lines (95 loc) · 7.14 KB

Catalogs

(Services.Catalogs)

Overview

Available Operations

  • Ingest - Ingest service catalog data
  • Refresh - Refresh a service catalog

Ingest

Accepts catalog data in the configured format and asyncronously processes the data to incorporate changes into service catalog.

Example Usage

package main

import(
	"firehydrant"
	"context"
	"firehydrant/models/components"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Services.Catalogs.Ingest(ctx, "<id>", components.PostV1CatalogsCatalogIDIngest{
        Encoding: components.EncodingApplicationJSON,
        Data: "<value>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.ImportsImportEntity != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
catalogID string ✔️ N/A
postV1CatalogsCatalogIDIngest components.PostV1CatalogsCatalogIDIngest ✔️ N/A
opts []operations.Option The options for this request.

Response

*operations.IngestCatalogDataResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*

Refresh

Schedules an async task to re-import catalog info and update catalog data accordingly.

Example Usage

package main

import(
	"firehydrant"
	"context"
	"log"
)

func main() {
    s := firehydrant.New(
        firehydrant.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Services.Catalogs.Refresh(ctx, "<id>")
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
catalogID string ✔️ N/A
opts []operations.Option The options for this request.

Response

*operations.RefreshCatalogResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.BadRequest 400, 413, 414, 415, 422, 431, 510 application/json
sdkerrors.Unauthorized 401, 403, 407, 511 application/json
sdkerrors.NotFound 404, 501, 505 application/json
sdkerrors.Timeout 408, 504 application/json
sdkerrors.RateLimited 429 application/json
sdkerrors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
sdkerrors.SDKError 4XX, 5XX */*