Skip to content

Latest commit

 

History

History
302 lines (194 loc) · 8.56 KB

CertificatesApi.md

File metadata and controls

302 lines (194 loc) · 8.56 KB

\CertificatesApi

All URIs are relative to https://api.lab5e.com

Method HTTP request Description
CreateCertificate Post /span/collections/{collectionId}/certificates/create Create certificate
RetrieveCertificateChain Get /span/collections/{collectionId}/certificates Get certificate chain
SignCertificate Post /span/collections/{collectionId}/certificates/sign Sign certificate
VerifyCertificate Post /span/collections/{collectionId}/certificates/verify Verify certificate

CreateCertificate

CreateCertificateResponse CreateCertificate(ctx, collectionId).Body(body).Execute()

Create certificate

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/lab5e/go-spanapi"
)

func main() {
    collectionId := "collectionId_example" // string | 
    body := *openapiclient.NewCreateCertificateBody() // CreateCertificateBody | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

body | CreateCertificateBody | |

Return type

CreateCertificateResponse

Authorization

APIToken

HTTP request headers

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

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

RetrieveCertificateChain

CertificateChainResponse RetrieveCertificateChain(ctx, collectionId).GatewayId(gatewayId).DeviceId(deviceId).Execute()

Get certificate chain

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/lab5e/go-spanapi"
)

func main() {
    collectionId := "collectionId_example" // string | 
    gatewayId := "gatewayId_example" // string |  (optional)
    deviceId := "deviceId_example" // string |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CertificatesApi.RetrieveCertificateChain(context.Background(), collectionId).GatewayId(gatewayId).DeviceId(deviceId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CertificatesApi.RetrieveCertificateChain``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `RetrieveCertificateChain`: CertificateChainResponse
    fmt.Fprintf(os.Stdout, "Response from `CertificatesApi.RetrieveCertificateChain`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

gatewayId | string | | deviceId | string | |

Return type

CertificateChainResponse

Authorization

APIToken

HTTP request headers

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

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

SignCertificate

SignCertificateResponse SignCertificate(ctx, collectionId).Body(body).Execute()

Sign certificate

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/lab5e/go-spanapi"
)

func main() {
    collectionId := "collectionId_example" // string | 
    body := *openapiclient.NewSignCertificateBody() // SignCertificateBody | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

body | SignCertificateBody | |

Return type

SignCertificateResponse

Authorization

APIToken

HTTP request headers

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

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

VerifyCertificate

VerifyCertificateResponse VerifyCertificate(ctx, collectionId).Body(body).Execute()

Verify certificate

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/lab5e/go-spanapi"
)

func main() {
    collectionId := "collectionId_example" // string | 
    body := *openapiclient.NewVerifyCertificateBody() // VerifyCertificateBody | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

body | VerifyCertificateBody | |

Return type

VerifyCertificateResponse

Authorization

APIToken

HTTP request headers

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

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