Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ require (
gopkg.in/yaml.v3 v3.0.1
)

require github.com/aziontech/azionapi-v4-go-sdk-dev v0.84.0
require github.com/aziontech/azionapi-v4-go-sdk-dev v0.182.0

require (
github.com/aws/aws-sdk-go-v2/service/signin v1.0.3 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ github.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk=
github.com/aws/smithy-go v1.24.0/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0=
github.com/aziontech/azionapi-go-sdk v0.143.0 h1:4eEBlYT10prgeCVTNR9FIc7f59Crbl2zrH1a4D1BUqU=
github.com/aziontech/azionapi-go-sdk v0.143.0/go.mod h1:cA5DY/VP4X5Eu11LpQNzNn83ziKjja7QVMIl4J45feA=
github.com/aziontech/azionapi-v4-go-sdk-dev v0.84.0 h1:WMBXtpqR+4LFzn1B05V4RmMIC/eF9OVbVp3OU/c45Wc=
github.com/aziontech/azionapi-v4-go-sdk-dev v0.84.0/go.mod h1:kJOyMICpeA+2xeo7/trGKGzMLdBMRKXM9A270vknSbI=
github.com/aziontech/azionapi-v4-go-sdk-dev v0.182.0 h1:D4WPAkWNjSsK3z+wDHC8QViJRYM5TgpZ1vfPjNw2D8Q=
github.com/aziontech/azionapi-v4-go-sdk-dev v0.182.0/go.mod h1:kJOyMICpeA+2xeo7/trGKGzMLdBMRKXM9A270vknSbI=
github.com/aziontech/go-thoth v0.0.0-20240228144710-d061a88cc39f h1:b0IX6tpiiG+QzCVOBqwYEHP5gPeeESq57A5ZXiYyDS4=
github.com/aziontech/go-thoth v0.0.0-20240228144710-d061a88cc39f/go.mod h1:v4AMg2JrM68ckr2nt7c7PRuOELek/JbVRa62+inlprQ=
github.com/aziontech/tablecli v0.0.0-20241007135202-07712c07aa9e h1:4jnF5abLeCo+SqWNvegJjFuK1FUpIuuy09Fsfj2Ys+0=
Expand Down
3 changes: 2 additions & 1 deletion messages/clone/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ package clone
import "errors"

var (
ErrorClone = errors.New("Failed to clone Application: %s")
ErrorClone = errors.New("Failed to clone Application: %s")
ErrorConvertApplicationId = errors.New("The Application ID you provided is invalid. The value must be an integer. You may run the 'azion list application' command to check your Application ID")
)
1 change: 1 addition & 0 deletions messages/connector/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ var (
ErrorFailToDeleteConnector = errors.New("Failed to delete the Connector: %s. Check your settings and try again. If the error persists, contact Azion support")
ErrorCreateConnector = errors.New("Failed to create Connector: %s. Check your settings and try again. If the error persists, contact Azion support")
ErrorUpdateConnector = errors.New("Failed to update the Connector: %s. Check your settings and try again. If the error persists, contact Azion support")
ErrorConvertConnectorId = errors.New("Invalid --connector-id flag provided. The value must be an integer. Run the command 'azion create function-instance --help' to display more information and try again")
)
2 changes: 1 addition & 1 deletion messages/connector/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var (
//delete cmd
DeleteShortDescription = "Deletes a Connector"
DeleteLongDescription = "Removes a Connector from the Connectors library based on its given ID"
DeleteOutputSuccess = "Connector %s was successfully deleted"
DeleteOutputSuccess = "Connector %d was successfully deleted"
DeleteHelpFlag = "Displays more information about the delete connector command"

//describe cmd
Expand Down
11 changes: 6 additions & 5 deletions messages/create/function_instance/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package functioninstance
import "errors"

var (
ErrorIsActiveFlag = errors.New("Invalid --active flag provided. The value must be 'true' or 'false'. Run the command 'azion create function-instance --help' to display more information and try again")
ErrorCreate = errors.New("Failed to create the Function Instance: %s. Check your settings and try again. If the error persists, contact Azion support")
ErrorArgsFlag = errors.New("Failed to read the args file. Verify if the file name and its path are correct and the file's content has a valid JSON format. Run the command again using the --help flag to display more information and try again")
ErrorParseArgs = errors.New("Failed to parse JSON args. Verify if the file's content has a valid JSON format. Run the command again using the --help flag to display more information and try again")
ErrorConvertFunctionID = errors.New("Invalid --function-id flag provided. The value must be an integer. Run the command 'azion create function-instance --help' to display more information and try again")
ErrorIsActiveFlag = errors.New("Invalid --active flag provided. The value must be 'true' or 'false'. Run the command 'azion create function-instance --help' to display more information and try again")
ErrorCreate = errors.New("Failed to create the Function Instance: %s. Check your settings and try again. If the error persists, contact Azion support")
ErrorArgsFlag = errors.New("Failed to read the args file. Verify if the file name and its path are correct and the file's content has a valid JSON format. Run the command again using the --help flag to display more information and try again")
ErrorParseArgs = errors.New("Failed to parse JSON args. Verify if the file's content has a valid JSON format. Run the command again using the --help flag to display more information and try again")
ErrorConvertFunctionID = errors.New("Invalid --function-id flag provided. The value must be an integer. Run the command 'azion create function-instance --help' to display more information and try again")
ErrorConvertApplicationId = errors.New("Invalid --application-id flag provided. The value must be an integer. Run the command 'azion create function-instance --help' to display more information and try again")
)
2 changes: 1 addition & 1 deletion messages/create/rules_engine/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ var (
ErrorStructCriteriaNil = errors.New("You must inform a criteria")
ErrorStructBehaviorsNil = errors.New("You must inform a behavior")
ErrorMandatoryCreateFlags = errors.New("Required flags are missing. You must provide the --application-id and --phase flags when the --application-id and --in flags are not provided. Run the command 'azion <command> <subcommand> --help' to display more information and try again.")
ErrorConvertIdApplication = errors.New("The application ID you provided is invalid. The value must be an integer. You may run the 'azion list application' command to check your application ID")
ErrorConvertApplicationId = errors.New("Invalid --application-id flag provided. The value must be an integer. Run the command 'azion create rules-engine --help' to display more information and try again")
)
1 change: 1 addition & 0 deletions messages/create/workload_deployment/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ var (
AskInputWorkloadID = "Enter the Workload's ID:"
AskInputDeploymentID = "Enter the Workload Deployment's ID:"
AskInputApplicationID = "Enter the Application's ID:"
AskInputFirewallID = "Enter the Firewall's ID:"
)
4 changes: 3 additions & 1 deletion messages/delete/function_instance/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ package functioninstance
import "errors"

var (
ErrorFailToDeletInstance = errors.New("Failed to delete Function Instance: %s")
ErrorFailToDeletInstance = errors.New("Failed to delete Function Instance: %s")
ErrorConvertApplicationId = errors.New("Invalid --application-id flag provided. The value must be an integer. Run the command 'azion delete function-instance --help' to display more information and try again")
ErrorConvertFunctionInstanceId = errors.New("Invalid --instance-id flag provided. The value must be an integer. Run the command 'azion delete function-instance --help' to display more information and try again")
)
15 changes: 8 additions & 7 deletions messages/delete/function_instance/messages.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package functioninstance

var (
Usage = "function-instance"
ShortDescription = "Deletes a Function Instance"
LongDescription = "Removes a Function Instance from the Function Instances library based on a given ID"
OutputSuccess = "Function Instance %s was successfully deleted"
HelpFlag = "Displays more information about the delete function-instance subcommand"
FlagId = "Unique identifier of the Function Instance"
AskDeleteInput = "Enter the ID of the Function Instance you wish to delete:"
Usage = "function-instance"
ShortDescription = "Deletes a Function Instance"
LongDescription = "Removes a Function Instance from the Function Instances library based on a given ID"
OutputSuccess = "Function Instance %s was successfully deleted"
HelpFlag = "Displays more information about the delete function-instance subcommand"
FlagId = "Unique identifier of the Function Instance"
AskDeleteInput = "Enter the ID of the Function Instance you wish to delete:"
AskDeleteApplicationInput = "Enter the ID of the Application you wish to delete:"
)
6 changes: 5 additions & 1 deletion messages/describe/function_instance/errors.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package functioninstance

import "errors"

var (
ErrorGetFunctionInstance = "Error getting Function Instance: %s"
ErrorGetFunctionInstance = "Error getting Function Instance: %s"
ErrorConvertApplicationId = errors.New("Invalid --application-id flag provided. The value must be an integer. Run the command 'azion describe function-instance --help' to display more information and try again")
ErrorConvertFunctionInstanceId = errors.New("Invalid --instance-id flag provided. The value must be an integer. Run the command 'azion describe function-instance --help' to display more information and try again")
)
1 change: 1 addition & 0 deletions messages/function/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ var (
ErrorGetFunctions = errors.New("Failed to list the Edge Functions: %s. Check your settings and try again. If the error persists, contact Azion support")
ErrorUpdateFunction = errors.New("Failed to update the Edge Function: %s. Check your settings and try again. If the error persists, contact Azion support")
ErrorConvertIdFunction = errors.New("The function ID you provided is invalid. The value must be an integer. You may run the 'azion list function' command to check your function ID")
ErrorConvertFunctionId = errors.New("Invalid --function-id flag provided. The value must be an integer. Run the command 'azion delete function --help' to display more information and try again")
)
2 changes: 1 addition & 1 deletion messages/function/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var (
//delete cmd
DeleteShortDescription = "Deletes a function"
DeleteLongDescription = "Removes a function from the functions library based on its given ID"
DeleteOutputSuccess = "Function %s was successfully deleted"
DeleteOutputSuccess = "Function %d was successfully deleted"
DeleteHelpFlag = "Displays more information about the delete function command"

//describe cmd
Expand Down
5 changes: 4 additions & 1 deletion messages/list/function_instance/errors.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package functioninstance

import "errors"

var (
ErrorGetAll = "Error getting Function Instances: %s. Check your settings and try again. If the error persists, contact Azion support."
ErrorGetAll = "Error getting Function Instances: %s. Check your settings and try again. If the error persists, contact Azion support."
ErrorConvertApplicationId = errors.New("Invalid --application-id flag provided. The value must be an integer. Run the command 'azion list function-instance --help' to display more information and try again")
)
1 change: 1 addition & 0 deletions messages/network_list/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ var (
ErrorCreateNetworkList = errors.New("Failed to create Network List: %w")
ErrorUpdateNetworkList = errors.New("Failed to update Network List: %w")
ErrorActiveFlag = errors.New("Invalid value for --active flag")
ErrorConvertNetworkListId = errors.New("Invalid --network-list-id flag provided. The value must be an integer. Run the command 'azion delete network-list --help' to display more information and try again")
)
2 changes: 1 addition & 1 deletion messages/network_list/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var (
DeleteShortDescription = "Deletes a Network List"
DeleteLongDescription = "Deletes a Network List based on a given ID"
DeleteHelpFlag = "Displays more information about the 'delete network-list' command"
DeleteOutputSuccess = "Network List %s was successfully deleted"
DeleteOutputSuccess = "Network List %d was successfully deleted"

DescribeShortDescription = "Displays a Network List"
DescribeLongDescription = "Displays a Network List based on a given ID"
Expand Down
9 changes: 5 additions & 4 deletions messages/rollback/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package rollback
import "errors"

var (
ERRORROLLBACK = errors.New("Failed to roll back to previous static files")
ERRORNEEDSDEPLOY = errors.New("You cannot use the rollback command unless you have already deployed this project. Please check if you are in the correct working directory")
ERRORAZION = errors.New("Failed to open the azion.json file. The file doesn't exist, is corrupted, or has an invalid JSON format")
ERRORNOPREVIOUS = errors.New("No previous deployment found to roll back to. You need at least two deployments to use the rollback command")
ERRORROLLBACK = errors.New("Failed to roll back to previous static files")
ERRORNEEDSDEPLOY = errors.New("You cannot use the rollback command unless you have already deployed this project. Please check if you are in the correct working directory")
ERRORAZION = errors.New("Failed to open the azion.json file. The file doesn't exist, is corrupted, or has an invalid JSON format")
ERRORNOPREVIOUS = errors.New("No previous deployment found to roll back to. You need at least two deployments to use the rollback command")
ERRORCONVERTCONNECTORID = errors.New("Invalid --connector-id flag provided. The value must be an integer. Run the command 'azion rollback --help' to display more information and try again")
)
10 changes: 6 additions & 4 deletions messages/update/function_instance/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ package functioninstance
import "errors"

var (
ErrorIsActiveFlag = errors.New("Invalid --active flag provided. The value must be 'true' or 'false'. Run the command 'azion update function-instance --help' to display more information and try again")
ErrorUpdate = errors.New("Failed to update the Function Instance: %s. Check your settings and try again. If the error persists, contact Azion support")
ErrorArgsFlag = errors.New("Failed to read the args file. Verify if the file name and its path are correct and the file's content has a valid JSON format. Run the command again using the --help flag to display more information and try again")
ErrorParseArgs = errors.New("Failed to parse JSON args. Verify if the file's content has a valid JSON format. Run the command again using the --help flag to display more information and try again")
ErrorIsActiveFlag = errors.New("Invalid --active flag provided. The value must be 'true' or 'false'. Run the command 'azion update function-instance --help' to display more information and try again")
ErrorUpdate = errors.New("Failed to update the Function Instance: %s. Check your settings and try again. If the error persists, contact Azion support")
ErrorArgsFlag = errors.New("Failed to read the args file. Verify if the file name and its path are correct and the file's content has a valid JSON format. Run the command again using the --help flag to display more information and try again")
ErrorParseArgs = errors.New("Failed to parse JSON args. Verify if the file's content has a valid JSON format. Run the command again using the --help flag to display more information and try again")
ErrorConvertApplicationId = errors.New("Invalid --application-id flag provided. The value must be an integer. Run the command 'azion update function-instance --help' to display more information and try again")
ErrorConvertFunctionInstanceId = errors.New("Invalid --instance-id flag provided. The value must be an integer. Run the command 'azion update function-instance --help' to display more information and try again")
)
6 changes: 3 additions & 3 deletions pkg/api/applications/cache_setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

// CreateCacheSettingsNextApplication this function creates the necessary Cache Settings for next applications
// to work correctly on the edge
func (c *Client) CreateCacheSettingsNextApplication(ctx context.Context, req *CreateCacheSettingsRequest, applicationID string) (sdk.CacheSetting, error) {
func (c *Client) CreateCacheSettingsNextApplication(ctx context.Context, req *CreateCacheSettingsRequest, applicationID int64) (sdk.CacheSetting, error) {
logger.Debug("Create Cache Settings Next Application")

BCache := sdk.BrowserCacheModuleRequest{}
Expand All @@ -39,7 +39,7 @@ func (c *Client) CreateCacheSettingsNextApplication(ctx context.Context, req *Cr
}

func (c *Client) CreateCacheEdgeApplication(
ctx context.Context, req *CreateCacheSettingsRequest, edgeApplicationID string,
ctx context.Context, req *CreateCacheSettingsRequest, edgeApplicationID int64,
) (sdk.CacheSetting, error) {
logger.Debug("Create Cache - Application")
resp, httpResp, err := c.apiClient.ApplicationsCacheSettingsAPI.
Expand All @@ -59,7 +59,7 @@ func (c *Client) CreateCacheEdgeApplication(
return resp.Data, nil
}

func (c *Client) ListCacheEdgeApp(ctx context.Context, edgeApplicationID string, opts *contracts.ListOptions) ([]sdk.ResponseListCacheSetting, error) {
func (c *Client) ListCacheEdgeApp(ctx context.Context, edgeApplicationID int64, opts *contracts.ListOptions) ([]sdk.ResponseListCacheSetting, error) {
logger.Debug("List Cache - Application")
resp, httpResp, err := c.apiClient.ApplicationsCacheSettingsAPI.
ListCacheSettings(ctx, edgeApplicationID).Ordering("id").PageSize(opts.PageSize).Page(opts.Page).Execute()
Expand Down
Loading
Loading