Skip to content

Commit

Permalink
Merge branch 'magic-gre-tunnels' of github.com:cehrig/cloudflare-go i…
Browse files Browse the repository at this point in the history
…nto magic-gre-tunnels
  • Loading branch information
cehrig committed Feb 2, 2022
2 parents a762b85 + f1ad354 commit 6eafe0f
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 75 deletions.
10 changes: 5 additions & 5 deletions magic_transit_gre_tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type DeleteMagicTransitGRETunnelResponse struct {
} `json:"result"`
}

// ListMagicTransitGRETunnels lists all GRE tunnels for a given account
// ListMagicTransitGRETunnels lists all GRE tunnels for a given account.
//
// API reference: https://api.cloudflare.com/#magic-gre-tunnels-list-gre-tunnels
func (api *API) ListMagicTransitGRETunnels(ctx context.Context, accountID string) ([]MagicTransitGRETunnel, error) {
Expand All @@ -95,7 +95,7 @@ func (api *API) ListMagicTransitGRETunnels(ctx context.Context, accountID string
return result.Result.GRETunnels, nil
}

// GetMagicTransitGRETunnel returns zero or one GRE tunnel
// GetMagicTransitGRETunnel returns zero or one GRE tunnel.
//
// API reference: https://api.cloudflare.com/#magic-gre-tunnels-gre-tunnel-details
func (api *API) GetMagicTransitGRETunnel(ctx context.Context, accountID string, id string) (MagicTransitGRETunnel, error) {
Expand All @@ -113,7 +113,7 @@ func (api *API) GetMagicTransitGRETunnel(ctx context.Context, accountID string,
return result.Result.GRETunnel, nil
}

// CreateMagicTransitGRETunnels creates one or more GRE tunnels
// CreateMagicTransitGRETunnels creates one or more GRE tunnels.
//
// API reference: https://api.cloudflare.com/#magic-gre-tunnels-create-gre-tunnels
func (api *API) CreateMagicTransitGRETunnels(ctx context.Context, accountID string, tunnels []MagicTransitGRETunnel) ([]MagicTransitGRETunnel, error) {
Expand All @@ -134,7 +134,7 @@ func (api *API) CreateMagicTransitGRETunnels(ctx context.Context, accountID stri
return result.Result.GRETunnels, nil
}

// UpdateMagicTransitGRETunnel updates a GRE tunnel
// UpdateMagicTransitGRETunnel updates a GRE tunnel.
//
// API reference: https://api.cloudflare.com/#magic-gre-tunnels-update-gre-tunnel
func (api *API) UpdateMagicTransitGRETunnel(ctx context.Context, accountID string, id string, tunnel MagicTransitGRETunnel) (MagicTransitGRETunnel, error) {
Expand All @@ -157,7 +157,7 @@ func (api *API) UpdateMagicTransitGRETunnel(ctx context.Context, accountID strin
return result.Result.ModifiedGRETunnel, nil
}

// DeleteMagicTransitGRETunnel deletes a GRE tunnel
// DeleteMagicTransitGRETunnel deletes a GRE tunnel.
//
// API reference: https://api.cloudflare.com/#magic-gre-tunnels-delete-gre-tunnel
func (api *API) DeleteMagicTransitGRETunnel(ctx context.Context, accountID string, id string) (MagicTransitGRETunnel, error) {
Expand Down
140 changes: 70 additions & 70 deletions magic_transit_gre_tunnel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ func TestListMagicTransitGRETunnels(t *testing.T) {
"gre_tunnels": [
{
"id": "c4a7362d577a6c3019a474fd6f485821",
"created_on": "2017-06-14T00:00:00Z",
"created_on": "2017-06-14T00:00:00Z",
"modified_on": "2017-06-14T05:20:00Z",
"name": "GRE_1",
"customer_gre_endpoint": "203.0.113.1",
"cloudflare_gre_endpoint": "203.0.113.2",
"interface_address": "192.0.2.0/31",
"description": "Tunnel for ISP X",
"ttl": 64,
"mtu": 1476,
"health_check": {
"enabled": true,
"target": "203.0.113.1",
"type": "request"
}
"cloudflare_gre_endpoint": "203.0.113.2",
"interface_address": "192.0.2.0/31",
"description": "Tunnel for ISP X",
"ttl": 64,
"mtu": 1476,
"health_check": {
"enabled": true,
"target": "203.0.113.1",
"type": "request"
}
}
]
}
Expand Down Expand Up @@ -89,22 +89,22 @@ func TestGetMagicTransitGRETunnel(t *testing.T) {
"messages": [],
"result": {
"gre_tunnel": {
"id": "c4a7362d577a6c3019a474fd6f485821",
"created_on": "2017-06-14T00:00:00Z",
"modified_on": "2017-06-14T05:20:00Z",
"name": "GRE_1",
"customer_gre_endpoint": "203.0.113.1",
"cloudflare_gre_endpoint": "203.0.113.2",
"interface_address": "192.0.2.0/31",
"description": "Tunnel for ISP X",
"ttl": 64,
"mtu": 1476,
"health_check": {
"enabled": true,
"target": "203.0.113.1",
"type": "request"
}
}
"id": "c4a7362d577a6c3019a474fd6f485821",
"created_on": "2017-06-14T00:00:00Z",
"modified_on": "2017-06-14T05:20:00Z",
"name": "GRE_1",
"customer_gre_endpoint": "203.0.113.1",
"cloudflare_gre_endpoint": "203.0.113.2",
"interface_address": "192.0.2.0/31",
"description": "Tunnel for ISP X",
"ttl": 64,
"mtu": 1476,
"health_check": {
"enabled": true,
"target": "203.0.113.1",
"type": "request"
}
}
}
}`)
}
Expand Down Expand Up @@ -153,20 +153,20 @@ func TestCreateMagicTransitGRETunnels(t *testing.T) {
"gre_tunnels": [
{
"id": "c4a7362d577a6c3019a474fd6f485821",
"created_on": "2017-06-14T00:00:00Z",
"created_on": "2017-06-14T00:00:00Z",
"modified_on": "2017-06-14T05:20:00Z",
"name": "GRE_1",
"customer_gre_endpoint": "203.0.113.1",
"cloudflare_gre_endpoint": "203.0.113.2",
"interface_address": "192.0.2.0/31",
"description": "Tunnel for ISP X",
"ttl": 64,
"mtu": 1476,
"health_check": {
"enabled": true,
"target": "203.0.113.1",
"type": "request"
}
"cloudflare_gre_endpoint": "203.0.113.2",
"interface_address": "192.0.2.0/31",
"description": "Tunnel for ISP X",
"ttl": 64,
"mtu": 1476,
"health_check": {
"enabled": true,
"target": "203.0.113.1",
"type": "request"
}
}
]
}
Expand Down Expand Up @@ -218,22 +218,22 @@ func TestUpdateMagicTransitGRETunnel(t *testing.T) {
"result": {
"modified": true,
"modified_gre_tunnel": {
"id": "c4a7362d577a6c3019a474fd6f485821",
"created_on": "2017-06-14T00:00:00Z",
"modified_on": "2017-06-14T05:20:00Z",
"name": "GRE_1",
"customer_gre_endpoint": "203.0.113.1",
"cloudflare_gre_endpoint": "203.0.113.2",
"interface_address": "192.0.2.0/31",
"description": "Tunnel for ISP X",
"ttl": 64,
"mtu": 1476,
"health_check": {
"enabled": true,
"target": "203.0.113.1",
"type": "request"
}
}
"id": "c4a7362d577a6c3019a474fd6f485821",
"created_on": "2017-06-14T00:00:00Z",
"modified_on": "2017-06-14T05:20:00Z",
"name": "GRE_1",
"customer_gre_endpoint": "203.0.113.1",
"cloudflare_gre_endpoint": "203.0.113.2",
"interface_address": "192.0.2.0/31",
"description": "Tunnel for ISP X",
"ttl": 64,
"mtu": 1476,
"health_check": {
"enabled": true,
"target": "203.0.113.1",
"type": "request"
}
}
}
}`)
}
Expand Down Expand Up @@ -281,22 +281,22 @@ func TestDeleteMagicTransitGRETunnel(t *testing.T) {
"result": {
"deleted": true,
"deleted_gre_tunnel": {
"id": "c4a7362d577a6c3019a474fd6f485821",
"created_on": "2017-06-14T00:00:00Z",
"modified_on": "2017-06-14T05:20:00Z",
"name": "GRE_1",
"customer_gre_endpoint": "203.0.113.1",
"cloudflare_gre_endpoint": "203.0.113.2",
"interface_address": "192.0.2.0/31",
"description": "Tunnel for ISP X",
"ttl": 64,
"mtu": 1476,
"health_check": {
"enabled": true,
"target": "203.0.113.1",
"type": "request"
}
}
"id": "c4a7362d577a6c3019a474fd6f485821",
"created_on": "2017-06-14T00:00:00Z",
"modified_on": "2017-06-14T05:20:00Z",
"name": "GRE_1",
"customer_gre_endpoint": "203.0.113.1",
"cloudflare_gre_endpoint": "203.0.113.2",
"interface_address": "192.0.2.0/31",
"description": "Tunnel for ISP X",
"ttl": 64,
"mtu": 1476,
"health_check": {
"enabled": true,
"target": "203.0.113.1",
"type": "request"
}
}
}
}`)
}
Expand Down

0 comments on commit 6eafe0f

Please sign in to comment.