Skip to content

Latest commit

 

History

History
211 lines (136 loc) · 5.31 KB

ImageAPI.md

File metadata and controls

211 lines (136 loc) · 5.31 KB

\ImageAPI

All URIs are relative to https://yasm.prodyna.com:443/api/graph/v1

Method HTTP request Description
DeleteImage Delete /images/{imageId} Delete Image
ReadImage Get /images/{imageId} Read an Image
UploadImage Post /images Upload an Image as binary and retrieve UUID

DeleteImage

Status DeleteImage(ctx, imageId).Execute()

Delete Image

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/prodyna-yasm/yasm-api-go"
)

func main() {
    imageId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ImageAPI.DeleteImage(context.Background(), imageId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ImageAPI.DeleteImage``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `DeleteImage`: Status
    fmt.Fprintf(os.Stdout, "Response from `ImageAPI.DeleteImage`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
imageId string

Other Parameters

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

Name Type Description Notes

Return type

Status

Authorization

oidcScheme, bearerScheme

HTTP request headers

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

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

ReadImage

*os.File ReadImage(ctx, imageId).Execute()

Read an Image

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/prodyna-yasm/yasm-api-go"
)

func main() {
    imageId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ImageAPI.ReadImage(context.Background(), imageId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ImageAPI.ReadImage``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ReadImage`: *os.File
    fmt.Fprintf(os.Stdout, "Response from `ImageAPI.ReadImage`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
imageId string

Other Parameters

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

Name Type Description Notes

Return type

*os.File

Authorization

oidcScheme, bearerScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: image/jpeg, application/json

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

UploadImage

ImageDetails UploadImage(ctx).Body(body).Execute()

Upload an Image as binary and retrieve UUID

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/prodyna-yasm/yasm-api-go"
)

func main() {
    body := os.NewFile(1234, "some_file") // *os.File |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ImageAPI.UploadImage(context.Background()).Body(body).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ImageAPI.UploadImage``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UploadImage`: ImageDetails
    fmt.Fprintf(os.Stdout, "Response from `ImageAPI.UploadImage`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
body *os.File

Return type

ImageDetails

Authorization

oidcScheme, bearerScheme

HTTP request headers

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

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