Skip to content

Latest commit

 

History

History
81 lines (54 loc) · 3.1 KB

DiffAPI.md

File metadata and controls

81 lines (54 loc) · 3.1 KB

DiffAPI

Note

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

Method HTTP request Description
DiffServiceVersions GET /service/{service_id}/diff/from/{from_version_id}/to/{to_version_id} Diff two service versions

DiffServiceVersions

Diff two service versions

Example

package main

import (
    "context"
    "fmt"
    "os"
    "github.com/fastly/fastly-go/fastly"
)

func main() {
    serviceID := "serviceId_example" // string | Alphanumeric string identifying the service.
    fromVersionID := int32(1) // int32 | The version number of the service to which changes in the generated VCL are being compared. Can either be a positive number from 1 to your maximum version or a negative number from -1 down (-1 is latest version etc).
    toVersionID := int32(2) // int32 | The version number of the service from which changes in the generated VCL are being compared. Uses same numbering scheme as `from`.
    format := "format_example" // string | Optional method to format the diff field. (optional) (default to "text")

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.DiffAPI.DiffServiceVersions(ctx, serviceID, fromVersionID, toVersionID).Format(format).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DiffAPI.DiffServiceVersions`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `DiffServiceVersions`: DiffResponse
    fmt.Fprintf(os.Stdout, "Response from `DiffAPI.DiffServiceVersions`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
serviceID string Alphanumeric string identifying the service.
fromVersionID int32 The version number of the service to which changes in the generated VCL are being compared. Can either be a positive number from 1 to your maximum version or a negative number from -1 down (-1 is latest version etc).
toVersionID int32 The version number of the service from which changes in the generated VCL are being compared. Uses same numbering scheme as from.

Other Parameters

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

Name Type Description Notes
format string Optional method to format the diff field. [default to "text"]

Return type

DiffResponse

Authorization

API Token

HTTP request headers

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

Back to top | Back to API list | Back to README