Skip to content

Commit

Permalink
chore: improve upload documentation #330
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Dec 28, 2024
1 parent 24ede6b commit a6619ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/cmd/integrations/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ func init() {
var name string

UploadCmd.Flags().StringVarP(&name, "name", "n",
"", "File containing Integration flow name")
"", "Integration flow name")
UploadCmd.Flags().StringVarP(&filePath, "file", "f",
"", "File containing an Integration flow json in stringified format. "+
"To send json, see integrationcli integrations versions patch")
"", "File containing an Integration flow json in the following format: \n"+
"{\n\t\"content\": The textproto of the IntegrationVersion,\n\t\"fileFormat\": Must be set to YAML or JSON\n}"+
"\nFor a sample see ./test/upload.json")

_ = UploadCmd.MarkFlagRequired("file")
}
4 changes: 4 additions & 0 deletions test/upload.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"content": "{\"snapshotNumber\": \"4\",\"triggerConfigs\": [{\"label\": \"API Trigger\",\"startTasks\": [{\"taskId\": \"1\"}],\"properties\": {\"Trigger name\": \"sample_API_1\"},\"triggerType\": \"API\",\"triggerNumber\": \"1\",\"triggerId\": \"api_trigger/sample_API_1\"}],\"taskConfigs\": [{\"task\": \"GenericRestV2Task\",\"taskId\": \"1\",\"parameters\": {\"throwError\": {\"key\": \"throwError\",\"value\": {\"booleanValue\": true}},\"responseBody\": {\"key\": \"responseBody\",\"value\": {\"stringArray\": {\"stringValues\": [\"$`Task_1_responseBody`$\"]}}},\"disableSSLValidation\": {\"key\": \"disableSSLValidation\",\"value\": {\"booleanValue\": false}},\"httpParams\": {\"key\": \"httpParams\"},\"responseHeader\": {\"key\": \"responseHeader\",\"value\": {\"stringArray\": {\"stringValues\": [\"$`Task_1_responseHeader`$\"]}}},\"userAgent\": {\"key\": \"userAgent\",\"value\": {\"stringValue\": \"\"}},\"httpMethod\": {\"key\": \"httpMethod\",\"value\": {\"stringValue\": \"GET\"}},\"responseStatus\": {\"key\": \"responseStatus\",\"value\": {\"stringArray\": {\"stringValues\": [\"$`Task_1_responseStatus`$\"]}}},\"url\": {\"key\": \"url\",\"value\": {\"stringValue\": \"https://httpbin.org/get\"}},\"urlFetchingService\": {\"key\": \"urlFetchingService\",\"value\": {\"stringValue\": \"HARPOON\"}},\"useSSL\": {\"key\": \"useSSL\",\"value\": {\"booleanValue\": false}},\"requestorId\": {\"key\": \"requestorId\",\"value\": {\"stringValue\": \"\"}},\"urlQueryStrings\": {\"key\": \"urlQueryStrings\"},\"requestBody\": {\"key\": \"requestBody\",\"value\": {\"stringValue\": \"\"}},\"followRedirects\": {\"key\": \"followRedirects\",\"value\": {\"booleanValue\": true}},\"additionalHeaders\": {\"key\": \"additionalHeaders\"}},\"taskExecutionStrategy\": \"WHEN_ALL_SUCCEED\",\"displayName\": \"Call httpbin service\"}],\"integrationParameters\": [{\"key\": \"`Task_1_responseHeader`\",\"dataType\": \"STRING_VALUE\",\"displayName\": \"`Task_1_responseHeader`\",\"isTransient\": true,\"producer\": \"1_1\"},{\"key\": \"`Task_1_responseBody`\",\"dataType\": \"STRING_VALUE\",\"displayName\": \"`Task_1_responseBody`\",\"isTransient\": true,\"producer\": \"1_1\"},{\"key\": \"`Task_1_responseStatus`\",\"dataType\": \"STRING_VALUE\",\"displayName\": \"`Task_1_responseStatus`\",\"isTransient\": true,\"producer\": \"1_1\"}],\"cloudLoggingDetails\": {\"cloudLoggingSeverity\": \"INFO\",\"enableCloudLogging\": true},\"databasePersistencePolicy\": \"DATABASE_PERSISTENCE_DISABLED\"}",
"fileFormat": "JSON"
}

0 comments on commit a6619ab

Please sign in to comment.