Skip to content

Latest commit

 

History

History
452 lines (298 loc) · 13.6 KB

File metadata and controls

452 lines (298 loc) · 13.6 KB

\ProjectsAPI

All URIs are relative to https://dashboard.quantcdn.io

Method HTTP request Description
GetProjectLogs Get /api/v2/organizations/{organization}/projects/{project}/logs Get CDN access logs for a project
ProjectsCreate Post /api/v2/organizations/{organization}/projects Create a new project
ProjectsDelete Delete /api/v2/organizations/{organization}/projects/{project} Delete a project
ProjectsList Get /api/v2/organizations/{organization}/projects Retrieve all projects for an organization
ProjectsRead Get /api/v2/organizations/{organization}/projects/{project} Get details of a single project
ProjectsUpdate Patch /api/v2/organizations/{organization}/projects/{project} Update a project

GetProjectLogs

GetProjectLogs200Response GetProjectLogs(ctx, organization, project).Limit(limit).StartTime(startTime).EndTime(endTime).Filter(filter).Domain(domain).NextToken(nextToken).Execute()

Get CDN access logs for a project

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/quantcdn/quant-admin-go"
)

func main() {
	organization := "test-org" // string | The organization machine name
	project := "test-project" // string | The project machine name
	limit := int32(56) // int32 | Maximum number of log entries to return per page (default 100) (optional) (default to 100)
	startTime := "2024-11-16T00:00:00Z" // string | Start of the time range. ISO 8601 or Unix epoch milliseconds. (optional)
	endTime := "2024-11-16T23:59:59Z" // string | End of the time range. ISO 8601 or Unix epoch milliseconds. (optional)
	filter := "$.status_code = 404" // string | CloudWatch JSON filter expression AND-ed with the project constraint, e.g. $.status_code = 404. Outer braces are optional; nested braces are rejected. (optional)
	domain := "www.example.com" // string | Only return entries for this domain (optional)
	nextToken := "nextToken_example" // string | Opaque pagination token from the previous response. Pass back unchanged to fetch the next page. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ProjectsAPI.GetProjectLogs(context.Background(), organization, project).Limit(limit).StartTime(startTime).EndTime(endTime).Filter(filter).Domain(domain).NextToken(nextToken).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProjectsAPI.GetProjectLogs``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetProjectLogs`: GetProjectLogs200Response
	fmt.Fprintf(os.Stdout, "Response from `ProjectsAPI.GetProjectLogs`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
organization string The organization machine name
project string The project machine name

Other Parameters

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

Name Type Description Notes

limit | int32 | Maximum number of log entries to return per page (default 100) | [default to 100] startTime | string | Start of the time range. ISO 8601 or Unix epoch milliseconds. | endTime | string | End of the time range. ISO 8601 or Unix epoch milliseconds. | filter | string | CloudWatch JSON filter expression AND-ed with the project constraint, e.g. $.status_code = 404. Outer braces are optional; nested braces are rejected. | domain | string | Only return entries for this domain | nextToken | string | Opaque pagination token from the previous response. Pass back unchanged to fetch the next page. |

Return type

GetProjectLogs200Response

Authorization

BearerAuth

HTTP request headers

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

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

ProjectsCreate

V2Project ProjectsCreate(ctx, organization).V2ProjectRequest(v2ProjectRequest).Execute()

Create a new project

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/quantcdn/quant-admin-go"
)

func main() {
	organization := "test-org" // string | Organization identifier
	v2ProjectRequest := *openapiclient.NewV2ProjectRequest() // V2ProjectRequest | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

v2ProjectRequest | V2ProjectRequest | |

Return type

V2Project

Authorization

BearerAuth

HTTP request headers

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

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

ProjectsDelete

ProjectsDelete(ctx, organization, project).Execute()

Delete a project

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/quantcdn/quant-admin-go"
)

func main() {
	organization := "test-org" // string | Organization identifier
	project := "test-project" // string | Project identifier

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.ProjectsAPI.ProjectsDelete(context.Background(), organization, project).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProjectsAPI.ProjectsDelete``: %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.
organization string Organization identifier
project string Project identifier

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

BearerAuth

HTTP request headers

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

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

ProjectsList

[]V2Project ProjectsList(ctx, organization).Execute()

Retrieve all projects for an organization

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/quantcdn/quant-admin-go"
)

func main() {
	organization := "test-org" // string | Organization identifier

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

[]V2Project

Authorization

BearerAuth

HTTP request headers

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

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

ProjectsRead

V2Project ProjectsRead(ctx, organization, project).WithToken(withToken).Execute()

Get details of a single project

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/quantcdn/quant-admin-go"
)

func main() {
	organization := "test-org" // string | Organization identifier
	project := "test-project" // string | Project identifier
	withToken := true // bool |  (default to false)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ProjectsAPI.ProjectsRead(context.Background(), organization, project).WithToken(withToken).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProjectsAPI.ProjectsRead``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ProjectsRead`: V2Project
	fmt.Fprintf(os.Stdout, "Response from `ProjectsAPI.ProjectsRead`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
organization string Organization identifier
project string Project identifier

Other Parameters

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

Name Type Description Notes

withToken | bool | | [default to false]

Return type

V2Project

Authorization

BearerAuth

HTTP request headers

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

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

ProjectsUpdate

V2Project ProjectsUpdate(ctx, organization, project).V2ProjectRequest(v2ProjectRequest).Execute()

Update a project

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/quantcdn/quant-admin-go"
)

func main() {
	organization := "test-org" // string | Organization identifier
	project := "test-project" // string | Project identifier
	v2ProjectRequest := *openapiclient.NewV2ProjectRequest() // V2ProjectRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ProjectsAPI.ProjectsUpdate(context.Background(), organization, project).V2ProjectRequest(v2ProjectRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProjectsAPI.ProjectsUpdate``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ProjectsUpdate`: V2Project
	fmt.Fprintf(os.Stdout, "Response from `ProjectsAPI.ProjectsUpdate`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
organization string Organization identifier
project string Project identifier

Other Parameters

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

Name Type Description Notes

v2ProjectRequest | V2ProjectRequest | |

Return type

V2Project

Authorization

BearerAuth

HTTP request headers

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

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