这是indexloc提供的服务,不要输入任何密码
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
4 changes: 0 additions & 4 deletions cmd/kvm/expentries.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import (

"internal/apiclient"

"internal/clilog"

"internal/client/kvm"

"github.com/spf13/cobra"
Expand All @@ -46,8 +44,6 @@ var ExpEntryCmd = &cobra.Command{
var payload [][]byte
var fileName string

clilog.Warning.Println("Running this command against a large number of KVMs or entries can exhaust the API quota")

if payload, err = kvm.ExportEntries(proxyName, mapName); err != nil {
return
}
Expand Down
4 changes: 0 additions & 4 deletions cmd/org/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ var ExportCmd = &cobra.Command{
return err
}

clilog.Warning.Println("Calls to Apigee APIs have a quota of 6000 per min. " +
"Running this tool against large list of entities can exhaust that quota and " +
"impact the usage of the platform.")

clilog.Info.Println("Exporting API Proxies...")
if err = apis.ExportProxies(conn, proxiesFolderName, allRevisions); proceedOnError(err) != nil {
return err
Expand Down
3 changes: 0 additions & 3 deletions cmd/org/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ var ImportCmd = &cobra.Command{
}

apiclient.DisableCmdPrintHttpResponse()
clilog.Warning.Println("Calls to Apigee APIs have a quota of 6000 per min. " +
"Running this tool against large list of entities can exhaust " +
"that quota and impact the usage of the platform.")

clilog.Info.Println("Importing API Proxies...")
if err = apis.ImportProxies(conn, path.Join(folder, proxiesFolderName)); err != nil {
Expand Down
2 changes: 0 additions & 2 deletions cmd/org/reportmonthly.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ var MonthlyCmd = &cobra.Command{

clilog.Warning.Println("This API is rate limited to 1 API Call per second")

clilog.Warning.Println("This API is rate limited to 1 API Call per second")

if _, err = time.Parse("1/2006", fmt.Sprintf("%d/%d", month, year)); err != nil {
return
}
Expand Down
2 changes: 0 additions & 2 deletions cmd/org/reportyearly.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ var YearlyCmd = &cobra.Command{

clilog.Warning.Println("This API is rate limited to 1 API Call per second")

clilog.Warning.Println("This API is rate limited to 1 API Call per second")

if _, err = time.Parse("2006", fmt.Sprintf("%d", year)); err != nil {
return
}
Expand Down
1 change: 1 addition & 0 deletions cmd/targetservers/expts.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var ExpCmd = &cobra.Command{
},
RunE: func(cmd *cobra.Command, args []string) (err error) {
const exportFileName = "targetservers.json"
apiclient.DisableCmdPrintHttpResponse()
payload, err := targetservers.Export(conn)
if err != nil {
return
Expand Down
9 changes: 7 additions & 2 deletions internal/client/apis/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,13 @@ func ExportProxies(conn int, folder string, allRevisions bool) (err error) {
}

for _, proxy := range prxs.Proxies {
for _, rev := range proxy.Revision {
jobChan <- revision{name: proxy.Name, rev: rev}
if allRevisions {
for _, rev := range proxy.Revision {
jobChan <- revision{name: proxy.Name, rev: rev}
}
} else {
lastRevision := maxRevision(proxy.Revision)
jobChan <- revision{name: proxy.Name, rev: lastRevision}
}
}
close(jobChan)
Expand Down
10 changes: 3 additions & 7 deletions internal/client/references/references.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,10 @@ func Update(name string, description string, resourceType string, refers string)

// Export
func Export(conn int) (payload [][]byte, err error) {
u, _ := url.Parse(apiclient.BaseURL)
u.Path = path.Join(u.Path, apiclient.GetApigeeOrg(), "environments", apiclient.GetApigeeEnv(), "references")
// don't print to sysout
apiclient.SetClientPrintHttpResponse(false)
respBody, err := apiclient.HttpClient(u.String())
apiclient.SetClientPrintHttpResponse(apiclient.GetCmdPrintHttpResponseSetting())
defer apiclient.SetClientPrintHttpResponse(apiclient.GetCmdPrintHttpResponseSetting())
respBody, err := List()
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -194,9 +192,7 @@ func exportReferences(wg *sync.WaitGroup, jobs <-chan string, results chan<- []b
if !ok {
return
}
u, _ := url.Parse(apiclient.BaseURL)
u.Path = path.Join(u.Path, apiclient.GetApigeeOrg(), "environments", apiclient.GetApigeeEnv(), "targetservers", job)
respBody, err := apiclient.HttpClient(u.String())
respBody, err := Get(job)
if err != nil {
errs <- err
} else {
Expand Down
12 changes: 9 additions & 3 deletions internal/client/sharedflows/sharedflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,15 @@ func Export(conn int, folder string, allRevisions bool) (err error) {
}

for _, proxy := range shrdflows.Flows {
for _, rev := range proxy.Revision {
jobChan <- revision{name: proxy.Name, rev: rev}
if allRevisions {
for _, rev := range proxy.Revision {
jobChan <- revision{name: proxy.Name, rev: rev}
}
} else {
lastRevision := maxRevision(proxy.Revision)
jobChan <- revision{name: proxy.Name, rev: lastRevision}
}

}
close(jobChan)
fanOutWg.Wait()
Expand Down Expand Up @@ -400,7 +406,7 @@ func exportSharedFlows(wg *sync.WaitGroup, jobs <-chan revision, folder string,
_ = fd.Close()

fpath := filepath.Join(folder, fname+".zip")
if err = os.Rename(filepath.Join(os.TempDir(), fd.Name()), fpath); err != nil {
if err = os.Rename(filepath.Join(fd.Name()), fpath); err != nil {
errs <- err
continue
}
Expand Down
11 changes: 4 additions & 7 deletions internal/client/targetservers/targetservers.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,11 @@ func List() (respBody []byte, err error) {

// Export
func Export(conn int) (payload [][]byte, err error) {
u, _ := url.Parse(apiclient.BaseURL)
u.Path = path.Join(u.Path, apiclient.GetApigeeOrg(), "environments", apiclient.GetApigeeEnv(), "targetservers")
// don't print to sysout
apiclient.SetClientPrintHttpResponse(false)
respBody, err := apiclient.HttpClient(u.String())
apiclient.SetClientPrintHttpResponse(apiclient.GetCmdPrintHttpResponseSetting())
defer apiclient.SetClientPrintHttpResponse(apiclient.GetCmdPrintHttpResponseSetting())

respBody, err := List()
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -230,9 +229,7 @@ func exportServers(wg *sync.WaitGroup, jobs <-chan string, results chan<- []byte
if !ok {
return
}
u, _ := url.Parse(apiclient.BaseURL)
u.Path = path.Join(u.Path, apiclient.GetApigeeOrg(), "environments", apiclient.GetApigeeEnv(), "targetservers", job)
respBody, err := apiclient.HttpClient(u.String())
respBody, err := Get(job)
if err != nil {
errs <- err
} else {
Expand Down