Skip to content

Latest commit

 

History

History
428 lines (282 loc) · 10.4 KB

DatabaseApi.md

File metadata and controls

428 lines (282 loc) · 10.4 KB

client\DatabaseApi

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

Method HTTP request Description
Create Post /v1/databases create
Delete Delete /v1/databases/{dbId} delete
Duplicate Post /v1/databases/{dbId}/duplicate duplicate
Get Get /v1/databases/{dbId} get
List Get /v1/databases list
Update Put /v1/databases/{dbId} update

Create

Database Create(ctx).ProjectId(projectId).Body(body).Execute()

create

Example

package main

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

func main() {
    projectId := int64(789) // int64 | projectId
    body := *gridly.NewCreateDatabase("Name_example") // CreateDatabase | body

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

Path Parameters

Other Parameters

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

Name Type Description Notes
projectId int64 projectId
body CreateDatabase body

Return type

Database

Authorization

ApiKey

HTTP request headers

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

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

Delete

Delete(ctx, dbId).Execute()

delete

Example

package main

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

func main() {
    dbId := "dbId_example" // string | dbId

    configuration := gridly.NewConfiguration()
    apiClient := gridly.NewAPIClient(configuration)
    resp, r, err := apiClient.DatabaseApi.Delete(context.Background(), dbId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DatabaseApi.Delete``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

Duplicate

Database Duplicate(ctx, dbId).ProjectId(projectId).Body(body).Execute()

duplicate

Example

package main

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

func main() {
    dbId := "dbId_example" // string | dbId
    projectId := int64(789) // int64 | projectId
    body := *gridly.NewCreateDatabase("Name_example") // CreateDatabase | body

    configuration := gridly.NewConfiguration()
    apiClient := gridly.NewAPIClient(configuration)
    resp, r, err := apiClient.DatabaseApi.Duplicate(context.Background(), dbId).ProjectId(projectId).Body(body).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DatabaseApi.Duplicate``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `Duplicate`: Database
    fmt.Fprintf(os.Stdout, "Response from `DatabaseApi.Duplicate`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

projectId | int64 | projectId | body | CreateDatabase | body |

Return type

Database

Authorization

ApiKey

HTTP request headers

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

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

Get

Database Get(ctx, dbId).Execute()

get

Example

package main

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

func main() {
    dbId := "dbId_example" // string | dbId

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

Database

Authorization

ApiKey

HTTP request headers

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

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

List

[]Database List(ctx).Expand(expand).Page(page).ProjectId(projectId).Search(search).Sort(sort).Execute()

list

Example

package main

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

func main() {
    expand := []string{"Expand_example"} // []string | expand (optional)
    page := "page_example" // string | page (optional) (default to "")
    projectId := int64(789) // int64 | projectId (optional)
    search := "search_example" // string | search (optional)
    sort := "sort_example" // string | sort (optional) (default to "")

    configuration := gridly.NewConfiguration()
    apiClient := gridly.NewAPIClient(configuration)
    resp, r, err := apiClient.DatabaseApi.List(context.Background()).Expand(expand).Page(page).ProjectId(projectId).Search(search).Sort(sort).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DatabaseApi.List``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `List`: []Database
    fmt.Fprintf(os.Stdout, "Response from `DatabaseApi.List`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
expand []string expand
page string page [default to ""]
projectId int64 projectId
search string search
sort string sort [default to ""]

Return type

[]Database

Authorization

ApiKey

HTTP request headers

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

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

Update

Database Update(ctx, dbId).Body(body).Execute()

update

Example

package main

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

func main() {
    dbId := "dbId_example" // string | dbId
    body := *gridly.NewUpdateDatabase("Name_example") // UpdateDatabase | body

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

body | UpdateDatabase | body |

Return type

Database

Authorization

ApiKey

HTTP request headers

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

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