diff --git a/.travis.yml b/.travis.yml index 6c860b98..0371ac9e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,28 +1,30 @@ group: bluezone -language: go -go: - - 1.21.3 -addons: - apt: - packages: - - python3 - - python3-pip - - python3-setuptools -install: - # Required to install detect-secrets - - echo -e "machine github.ibm.com\n login $CI_USER_TOKEN" > ~/.netrc - - sudo python3 -m pip install -U pip - - sudo pip3 install pyOpenSSL --upgrade - - sudo pip3 install --upgrade "git+https://github.com/ibm/detect-secrets.git@master#egg=detect-secrets" - - curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $GOPATH/bin -before_script: - - go vet $(go list ./... | grep -v "fixtures" | grep -v "vendor") - - go test $(go list ./... | grep -v "fixtures" | grep -v "vendor") - - detect-secrets scan --update .secrets.baseline - - detect-secrets audit .secrets.baseline --report --fail-on-unaudited --omit-instructions - - gosec -exclude-dir=fixture -exclude-dir=plugin/resources -quiet ./... -script: - - go build +jobs: + include: + - language: python + python: 3.12 + install: + - echo -e "machine github.ibm.com\n login $CI_USER_TOKEN" > ~/.netrc + - python3 -m pip install -U pip + - pip3 install importlib_metadata + - pip3 install pyOpenSSL --upgrade + - pip3 install --upgrade "git+https://github.com/ibm/detect-secrets.git@master#egg=detect-secrets" + script: + - detect-secrets scan --update .secrets.baseline + - detect-secrets audit .secrets.baseline --report --fail-on-unaudited --omit-instructions + - language: go + go: 1.21.3 + install: + # Required to install detect-secrets + - echo -e "machine github.ibm.com\n login $CI_USER_TOKEN" > ~/.netrc + - curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $GOPATH/bin + before_script: + - go vet $(go list ./... | grep -v "fixtures" | grep -v "vendor") + - go test $(go list ./... | grep -v "fixtures" | grep -v "vendor") + - gosec -exclude-dir=fixture -exclude-dir=plugin/resources -quiet ./... + script: + - go build + notifications: slack: rooms: ibm-cloudplatform:RZfnTv0P664KhVAtEAjcEBPJ diff --git a/README.md b/README.md index 7d57e5f4..bc0850b2 100644 --- a/README.md +++ b/README.md @@ -576,6 +576,14 @@ ENV Variables that need to be set: 1. `JENKINS_TOKEN` : Auth token to run Jenkins. Username is hardcoded for me at the moment. 2. `IBMCLOUD_APIKEY` : API key for using `ibmcloud`. This is how we upload to COS. The COS plugin needs to be installed as well. `ibmcloud plugin install cloud-object-storage` +## Manually + +Process is described in more detail on [bluemix-cli-repo](https://github.ibm.com/ibmcloud-cli/bluemix-cli-repo) + +1. Create the plugin changes with this [Jenkins Job](https://wcp-cloud-foundry-jenkins.swg-devops.com/job/Publish%20Plugin%20to%20YS1/build). +2. That will create a pull request on the [bluemix-cli-repo](https://github.ibm.com/ibmcloud-cli/bluemix-cli-repo/pulls) for a STAGING version +3. TEST +4. [Promote from staging to product](https://wcp-cloud-foundry-jenkins.swg-devops.com/job/Promote%20Plugin%20from%20staging%20to%20production/) This will open a pull request that needs to be approved. # Documentation diff --git a/bin/buildAndDeploy.py b/bin/buildAndDeploy.py index c5da176f..442e5b44 100755 --- a/bin/buildAndDeploy.py +++ b/bin/buildAndDeploy.py @@ -94,6 +94,9 @@ def runTests() -> None: except subprocess.CalledProcessError as e: print(f"[red]>>> Go Test failed <<<") sys.exit(e.returncode) + +def runGoSec() -> None: + """Runs gpsec""" go_sec = ['gosec', '-exclude-dir=fixture', '-exclude-dir=plugin/resources', '-exclude-generated', './...'] # Not using the 'real' command because this is more copy/pasteable. print('[turquoise2]Running: ' + " ".join(go_sec)) @@ -392,6 +395,12 @@ def test(ctx): """Runs the tests""" runTests() +@cli.command() +@click.pass_context +def gosec(ctx): + """Runs the tests""" + runGoSec() + @cli.command() @click.pass_context def i18n(ctx): @@ -412,8 +421,3 @@ def docs(ctx, out_path): if __name__ == '__main__': cli() - # try: - # cli() - # except Exception as e: - # print(f"[red]{e}") - diff --git a/bin/goi18n2 b/bin/goi18n2 old mode 100644 new mode 100755 diff --git a/go.mod b/go.mod index 4303a343..a564dd7d 100644 --- a/go.mod +++ b/go.mod @@ -8,25 +8,25 @@ require ( github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1 github.com/miekg/dns v1.1.61 github.com/nicksnyder/go-i18n/v2 v2.4.0 - github.com/onsi/ginkgo/v2 v2.17.1 - github.com/onsi/gomega v1.33.0 + github.com/onsi/ginkgo/v2 v2.20.1 + github.com/onsi/gomega v1.36.1 github.com/sethvargo/go-password v0.3.1 github.com/softlayer/softlayer-go v1.1.6 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 - golang.org/x/text v0.16.0 + golang.org/x/text v0.21.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/color v1.17.0 // indirect github.com/fatih/structs v1.1.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect - github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/gofrs/flock v0.12.0 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect + github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kr/text v0.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -36,13 +36,13 @@ require ( github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/softlayer/xmlrpc v0.0.0-20200409220501-5f089df7cb7e // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/mod v0.18.0 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/crypto v0.31.0 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/tools v0.24.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 //indirect ) diff --git a/go.sum b/go.sum index 36e4d28b..d00ae66d 100644 --- a/go.sum +++ b/go.sum @@ -4,9 +4,6 @@ github.com/IBM-Cloud/ibm-cloud-cli-sdk v1.4.0 h1:Q+zEWnb3z9vfWOkCRlNziO5Pd7i2xwX github.com/IBM-Cloud/ibm-cloud-cli-sdk v1.4.0/go.mod h1:XxWyb5MQDU4GnRBSDZpGgIFwfbcn+GAUbPKS8CR8Bxc= github.com/Xuanwo/go-locale v1.1.0 h1:51gUxhxl66oXAjI9uPGb2O0qwPECpriKQb2hl35mQkg= github.com/Xuanwo/go-locale v1.1.0/go.mod h1:UKrHoZB3FPIk9wIG2/tVSobnHgNnceGSH3Y8DY5cASs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -16,19 +13,18 @@ github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/gofrs/flock v0.12.0 h1:xHW8t8GPAiGtqz7KxiSqfOEXwpOaqhpYZrTE2MQBgXY= github.com/gofrs/flock v0.12.0/go.mod h1:FirDy1Ing0mI2+kB6wk+vyyAH+e6xiE+EYA0jnzV9jc= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jarcoal/httpmock v1.0.5 h1:cHtVEcTxRSX4J0je7mWPfc9BpDpqzXSJ5HbymZmyHck= @@ -52,10 +48,10 @@ github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs= github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ= github.com/nicksnyder/go-i18n/v2 v2.4.0 h1:3IcvPOAvnCKwNm0TB0dLDTuawWEj+ax/RERNC+diLMM= github.com/nicksnyder/go-i18n/v2 v2.4.0/go.mod h1:nxYSZE9M0bf3Y70gPQjN9ha7XNHX7gMc814+6wVyEI4= -github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= -github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= -github.com/onsi/gomega v1.33.0 h1:snPCflnZrpMsy94p4lXVEkHo12lmPnc3vY5XBbreexE= -github.com/onsi/gomega v1.33.0/go.mod h1:+925n5YtiFsLzzafLUHzVMBpvvRAzrydIBiSIxjX3wY= +github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo= +github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= +github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw= +github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -81,39 +77,37 @@ github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3k github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20211023085530-d6a326fbbf70/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/plugin/commands/account/account_test.go b/plugin/commands/account/account_test.go index 39d17113..d3a1885f 100644 --- a/plugin/commands/account/account_test.go +++ b/plugin/commands/account/account_test.go @@ -4,6 +4,7 @@ import ( "github.com/IBM-Cloud/ibm-cloud-cli-sdk/testhelpers/terminal" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/onsi/gomega/format" "github.ibm.com/SoftLayer/softlayer-cli/plugin/commands/account" "github.ibm.com/SoftLayer/softlayer-cli/plugin/metadata" "github.ibm.com/SoftLayer/softlayer-cli/plugin/testhelpers" @@ -33,8 +34,11 @@ var availableCommands = []string{ "summary", } + // This test suite exists to make sure commands don't get accidently removed from the actionBindings var _ = Describe("Test account.GetCommandActionBindings()", func() { + format.TruncatedDiff = false + format.UseStringerRepresentation = false fakeUI := terminal.NewFakeUI() fakeSession := testhelpers.NewFakeSoftlayerSession(nil) slMeta := metadata.NewSoftlayerCommand(fakeUI, fakeSession) diff --git a/plugin/commands/account/invoice-detail.go b/plugin/commands/account/invoice-detail.go index 6341ba3a..5f15ea99 100644 --- a/plugin/commands/account/invoice-detail.go +++ b/plugin/commands/account/invoice-detail.go @@ -86,23 +86,36 @@ func PrintInvoiceDetail(invoiceID int, invoice []datatypes.Billing_Invoice_Item, if invoiceDetail.Location != nil { location = utils.FormatStringPointer(invoiceDetail.Location.Name) } + oneTime, recurring := SumChildItems(invoiceDetail) table.Add( utils.FormatIntPointer(invoiceDetail.Id), Category, utils.ShortenString(Description), - fmt.Sprintf("%.2f", *invoiceDetail.OneTimeAfterTaxAmount), - fmt.Sprintf("%.2f", *invoiceDetail.RecurringAfterTaxAmount), - utils.FormatSLTimePointer(invoiceDetail.CreateDate), + fmt.Sprintf("%.2f", oneTime), + fmt.Sprintf("%.2f", recurring), + utils.FormatSLTimePointerCustom(invoiceDetail.CreateDate, "2006-01-02"), location, ) if details { + // Add in the parent row if we are doing details, so its obvious how the top line item adds up. + if len(invoiceDetail.Children) > 0 { + table.Add( + ">>>", + Category, + utils.ShortenString(Description), + fmt.Sprintf("%.2f", *invoiceDetail.OneTimeAfterTaxAmount), + fmt.Sprintf("%.2f", *invoiceDetail.RecurringAfterTaxAmount), + "---", + "---", + ) + } for _, child := range invoiceDetail.Children { table.Add( ">>>", utils.FormatStringPointer(child.Category.Name), utils.ShortenString(utils.FormatStringPointer(child.Description)), - fmt.Sprintf("%.2f", *invoiceDetail.OneTimeAfterTaxAmount), - fmt.Sprintf("%.2f", *invoiceDetail.RecurringAfterTaxAmount), + fmt.Sprintf("%.2f", *child.OneTimeAfterTaxAmount), + fmt.Sprintf("%.2f", *child.RecurringAfterTaxAmount), "---", "---", ) @@ -111,3 +124,16 @@ func PrintInvoiceDetail(invoiceID int, invoice []datatypes.Billing_Invoice_Item, } utils.PrintTable(ui, table, outputFormat) } + +func SumChildItems(item datatypes.Billing_Invoice_Item) (oneTime float64, recurring float64) { + oneTime = float64((*item.OneTimeAfterTaxAmount)) + recurring = float64((*item.RecurringAfterTaxAmount)) + + for _, child := range item.Children { + oneTime += float64((*child.OneTimeAfterTaxAmount)) + recurring += float64((*child.RecurringAfterTaxAmount)) + } + return oneTime, recurring + + +} \ No newline at end of file diff --git a/plugin/commands/account/invoice-detail_test.go b/plugin/commands/account/invoice-detail_test.go index 016def89..ab5e9a93 100644 --- a/plugin/commands/account/invoice-detail_test.go +++ b/plugin/commands/account/invoice-detail_test.go @@ -55,20 +55,24 @@ var _ = Describe("Account list InvoiceDetail", func() { It("return account invoice detail", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "123") Expect(err).NotTo(HaveOccurred()) - Expect(fakeUI.Outputs()).To(ContainSubstring("Item Id Category Description Single Monthly Create Date Location")) - Expect(fakeUI.Outputs()).To(ContainSubstring("123456789 Server Dual Intel Xeon Silver 4210 (20 Cores, 2.20 GHz) (test-gpu.softlayer-community-f... 10.23 20.34 2022-04-04T05:10:20Z mex01")) - Expect(fakeUI.Outputs()).To(ContainSubstring("123456789123 server Dual E5-2690 v3 (12 Cores, 2.60 GHz) (test-vs.support2.com) 11.23 21.12 2022-04-04T05:10:21Z ams01")) + Expect(fakeUI.Outputs()).To(ContainSubstring("Item Id Category Description Single Monthly Create Date Location")) + Expect(fakeUI.Outputs()).To(ContainSubstring("123456789 Server Dual Intel Xeon Silver 4210 (20 Cores, 2.20 GHz) (test-gpu.softlayer-community-f... 22.59 35.26 2022-04-04 mex01")) + Expect(fakeUI.Outputs()).To(ContainSubstring("123456789123 server Dual E5-2690 v3 (12 Cores, 2.60 GHz) (test-vs.support2.com) 23.81 36.04 2022-04-04 ams01")) }) It("return account invoice detail with additionals details", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "123", "--details") Expect(err).NotTo(HaveOccurred()) - Expect(fakeUI.Outputs()).To(ContainSubstring("Item Id Category Description Single Monthly Create Date Location")) - Expect(fakeUI.Outputs()).To(ContainSubstring("123456789 Server Dual Intel Xeon Silver 4210 (20 Cores, 2.20 GHz) (test-gpu.softlayer-community-f... 10.23 20.34 2022-04-04T05:10:20Z mex01")) - Expect(fakeUI.Outputs()).To(ContainSubstring(">>> Second Processor Intel Xeon (12 Cores, 2.40 GHz) 10.23 20.34 --- ---")) - Expect(fakeUI.Outputs()).To(ContainSubstring(">>> Operating System Virtual (up to 1Gbps) 10.23 20.34 --- ---")) - Expect(fakeUI.Outputs()).To(ContainSubstring("123456789123 server Dual E5-2690 v3 (12 Cores, 2.60 GHz) (test-vs.support2.com) 11.23 21.12 2022-04-04T05:10:21Z ams01")) - Expect(fakeUI.Outputs()).To(ContainSubstring(">>> Second Processor Intel Xeon (12 Cores, 2.40 GHz) 11.23 21.12 --- ---")) - Expect(fakeUI.Outputs()).To(ContainSubstring(">>> Operating System Virtual (up to 1Gbps) 11.23 21.12 --- ---")) + Expect(fakeUI.Outputs()).To(Equal( +`Item Id Category Description Single Monthly Create Date Location +123456789 Server Dual Intel Xeon Silver 4210 (20 Cores, 2.20 GHz) (test-gpu.softlayer-community-f... 22.59 35.26 2022-04-04 mex01 +>>> Server Dual Intel Xeon Silver 4210 (20 Cores, 2.20 GHz) (test-gpu.softlayer-community-f... 10.23 20.34 --- --- +>>> Second Processor Intel Xeon (12 Cores, 2.40 GHz) 5.24 6.12 --- --- +>>> Operating System Virtual (up to 1Gbps) 7.12 8.79 --- --- +123456789123 server Dual E5-2690 v3 (12 Cores, 2.60 GHz) (test-vs.support2.com) 23.81 36.04 2022-04-04 ams01 +>>> server Dual E5-2690 v3 (12 Cores, 2.60 GHz) (test-vs.support2.com) 11.23 21.12 --- --- +>>> Second Processor Intel Xeon (12 Cores, 2.40 GHz) 5.35 6.23 --- --- +>>> Operating System Virtual (up to 1Gbps) 7.23 8.68 --- --- +`)) }) It("return account invoice detail in format json", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "123", "--output", "json") @@ -76,8 +80,8 @@ var _ = Describe("Account list InvoiceDetail", func() { Expect(fakeUI.Outputs()).To(ContainSubstring(`"Item Id": "123456789",`)) Expect(fakeUI.Outputs()).To(ContainSubstring(`"Category": "Server",`)) Expect(fakeUI.Outputs()).To(ContainSubstring(`"Description": "Dual Intel Xeon Silver 4210 (20 Cores, 2.20 GHz) (test-gpu.softlayer-community-f...",`)) - Expect(fakeUI.Outputs()).To(ContainSubstring(`"Single": "10.23",`)) - Expect(fakeUI.Outputs()).To(ContainSubstring(`"Monthly": "20.34",`)) + Expect(fakeUI.Outputs()).To(ContainSubstring(`"Single": "22.59",`)) + Expect(fakeUI.Outputs()).To(ContainSubstring(`"Monthly": "35.26",`)) Expect(fakeUI.Outputs()).To(ContainSubstring(`"Location": "mex01"`)) }) }) @@ -92,8 +96,8 @@ var _ = Describe("Account list InvoiceDetail", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "888") Expect(err).NotTo(HaveOccurred()) output := fakeUI.Outputs() - Expect(output).To(ContainSubstring("2020-05-04T05:11:25Z None")) - Expect(output).To(ContainSubstring("2020-05-04T05:11:25Z tok02")) + Expect(output).To(ContainSubstring("2020-05-04 None")) + Expect(output).To(ContainSubstring("0.00 0.00 2020-05-04 tok02")) }) }) }) diff --git a/plugin/commands/block/volume_count_test.go b/plugin/commands/block/volume_count_test.go index 4e6e1a20..984a9626 100644 --- a/plugin/commands/block/volume_count_test.go +++ b/plugin/commands/block/volume_count_test.go @@ -46,7 +46,7 @@ var _ = Describe("Volume cancel", func() { It("return error", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "1234") Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("unknown command 1234 for volume-count")) + Expect(err.Error()).To(ContainSubstring("Incorrect Usage: invalid argument 1234 for volume-count")) }) }) Context("Volume Count Happy Path", func() { diff --git a/plugin/commands/file/volume_count_test.go b/plugin/commands/file/volume_count_test.go index 9532b925..0796764f 100644 --- a/plugin/commands/file/volume_count_test.go +++ b/plugin/commands/file/volume_count_test.go @@ -46,7 +46,7 @@ var _ = Describe("Volume cancel", func() { It("return error", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "1234") Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("unknown command 1234 for volume-count")) + Expect(err.Error()).To(ContainSubstring("Incorrect Usage: invalid argument 1234 for volume-count")) }) }) Context("Volume Count Happy Path", func() { diff --git a/plugin/commands/tags/set.go b/plugin/commands/tags/set.go index cda51fe2..9e396a8b 100644 --- a/plugin/commands/tags/set.go +++ b/plugin/commands/tags/set.go @@ -26,9 +26,7 @@ func NewSetCommand(sl *metadata.SoftlayerCommand) (cmd *SetCommand) { cobraCmd := &cobra.Command{ Use: "set", Short: T("Set Tags."), - Long: T(`${COMMAND_NAME} sl tags set [OPTIONS] - -EXAMPLE: + Long: T(`EXAMPLE: ${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456 `), Args: metadata.NoArgs, @@ -37,10 +35,12 @@ EXAMPLE: }, } - cobraCmd.Flags().StringVar(&thisCmd.Tags, "tags", "", T("Comma seperated list of tags, enclosed in quotes. 'tag1,tag2' [required]")) - cobraCmd.Flags().StringVar(&thisCmd.KeyName, "key-name", "", T("Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output. [required]")) - cobraCmd.Flags().IntVar(&thisCmd.ResourceId, "resource-id", 0, T("ID of the object being tagged [required]")) - + cobraCmd.Flags().StringVar(&thisCmd.Tags, "tags", "", T("Comma seperated list of tags, enclosed in quotes. 'tag1,tag2'")) + cobraCmd.Flags().StringVar(&thisCmd.KeyName, "key-name", "", T("Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output.")) + cobraCmd.Flags().IntVar(&thisCmd.ResourceId, "resource-id", 0, T("ID of the object being tagged")) + cobraCmd.MarkFlagRequired("tags") //#nosec G104 -- This is a false positive + cobraCmd.MarkFlagRequired("key-name") //#nosec G104 -- This is a false positive + cobraCmd.MarkFlagRequired("resource-id") //#nosec G104 -- This is a false positive thisCmd.Command = cobraCmd return thisCmd } @@ -49,17 +49,6 @@ func (cmd *SetCommand) Run(args []string) error { tags := cmd.Tags keyName := cmd.KeyName resourceId := cmd.ResourceId - - if tags == "" { - return errors.NewMissingInputError("--tags") - } - if keyName == "" { - return errors.NewMissingInputError("--key-name") - } - if resourceId == 0 { - return errors.NewMissingInputError("--resource-id") - } - response, err := cmd.TagsManager.SetTags(tags, keyName, resourceId) if err != nil { return errors.NewAPIError(T("Failed to set tags."), err.Error(), 2) diff --git a/plugin/commands/tags/set_test.go b/plugin/commands/tags/set_test.go index 7e710dbd..fdef0476 100644 --- a/plugin/commands/tags/set_test.go +++ b/plugin/commands/tags/set_test.go @@ -37,19 +37,19 @@ var _ = Describe("tags set", func() { It("Set command without required --tags option", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "--key-name=HARDWARE", "--resource-id=123456") Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("Incorrect Usage: '--tags' is required")) + Expect(err.Error()).To(ContainSubstring(`required flag(s) "tags" not set`)) }) It("Set command without required --key-name option", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "--tags='tag1,tag2'", "--resource-id=123456") Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("Incorrect Usage: '--key-name' is required")) + Expect(err.Error()).To(ContainSubstring(`required flag(s) "key-name" not set`)) }) It("Set command without required --resource-id option", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "--tags='tag1,tag2'", "--key-name=HARDWARE") Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("Incorrect Usage: '--resource-id' is required")) + Expect(err.Error()).To(ContainSubstring(`required flag(s) "resource-id" not set`)) }) It("Set invalid resource-id option", func() { diff --git a/plugin/commands/virtual/create.go b/plugin/commands/virtual/create.go index a89b960b..3d4c468b 100644 --- a/plugin/commands/virtual/create.go +++ b/plugin/commands/virtual/create.go @@ -28,6 +28,7 @@ type CreateCommand struct { Dedicated bool Private bool San bool + Local bool Test bool Transient bool Force bool @@ -72,9 +73,7 @@ func NewCreateCommand(sl *metadata.SoftlayerCommand) (cmd *CreateCommand) { cobraCmd := &cobra.Command{ Use: "create", Short: T("Create virtual server instance"), - Long: T(`${COMMAND_NAME} sl vs create [OPTIONS] - -EXAMPLE: + Long: T(`EXAMPLE: ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 This command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10, operation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413. @@ -91,6 +90,7 @@ EXAMPLE: cobraCmd.Flags().BoolVar(&thisCmd.Dedicated, "dedicated", false, T("Create a dedicated Virtual Server (Private Node)")) cobraCmd.Flags().BoolVar(&thisCmd.Private, "private", false, T("Forces the virtual server to only have access the private network")) cobraCmd.Flags().BoolVar(&thisCmd.San, "san", false, T("Use SAN storage instead of local disk")) + cobraCmd.Flags().BoolVar(&thisCmd.Local, "local", false, T("Use local disk storage.")) cobraCmd.Flags().BoolVar(&thisCmd.Test, "test", false, T("Do not actually create the virtual server")) cobraCmd.Flags().BoolVar(&thisCmd.Transient, "transient", false, T("Create a transient virtual server")) cobraCmd.Flags().BoolVarP(&thisCmd.Force, "force", "f", false, T("Force operation without confirmation")) @@ -124,6 +124,7 @@ EXAMPLE: cobraCmd.Flags().StringVarP(&thisCmd.Template, "template", "t", "", T("A template file that defaults the command-line options")) cobraCmd.Flags().StringVarP(&thisCmd.Userdata, "userdata", "u", "", T("User defined metadata string")) cobraCmd.Flags().StringVarP(&thisCmd.Userfile, "userfile", "F", "", T("Read userdata from file")) + cobraCmd.MarkFlagsMutuallyExclusive("san", "local") return thisCmd } @@ -446,6 +447,8 @@ func (cmd *CreateCommand) verifyParams() (map[string]interface{}, error) { if cmd.San { params["san"] = true + } else if cmd.Local { + params["san"] = false } if cmd.PostInstall != "" { diff --git a/plugin/commands/virtual/create_test.go b/plugin/commands/virtual/create_test.go index ee59a1f7..631ac812 100644 --- a/plugin/commands/virtual/create_test.go +++ b/plugin/commands/virtual/create_test.go @@ -26,6 +26,7 @@ var _ = Describe("VS create", func() { fakeSession *session.Session slCommand *metadata.SoftlayerCommand fakeVSManager *testhelpers.FakeVirtualServerManager + fakeServer datatypes.Virtual_Guest ) BeforeEach(func() { fakeUI = terminal.NewFakeUI() @@ -35,171 +36,73 @@ var _ = Describe("VS create", func() { cliCommand = virtual.NewCreateCommand(slCommand) cliCommand.Command.PersistentFlags().Var(cliCommand.OutputFlag, "output", "--output=JSON for json output.") cliCommand.VirtualServerManager = fakeVSManager + // These APIS are generally called for vs create + created, _ := time.Parse(time.RFC3339, "2017-01-03T00:00:00Z") + fakeServer = datatypes.Virtual_Guest{ + Id: sl.Int(1234), + FullyQualifiedDomainName: sl.String("vs-abc.wilma.com"), + GlobalIdentifier: sl.String("dhtyengodyhebt"), + CreateDate: sl.Time(created), + } + fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, nil) + fakeVSManager.VerifyInstanceCreationReturns(datatypes.Container_Product_Order{}, nil) + fakeVSManager.CreateInstanceReturns(fakeServer, nil) + fakeVSManager.InstanceIsReadyReturns(true, "", nil) }) Describe("VS create", func() { Context("VS create with incorrect parameters", func() { - It("return error", func() { + BeforeEach(func() { + fakeUI.Inputs("yes", "") + }) + It("Flavor/CPU Conflict", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "--flavor", "C1_1X1X100", "-c", "1") Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("Incorrect Usage: '[-c|--cpu]', '[--flavor]' are exclusive.")) }) - }) - Context("VS create with incorrect parameters", func() { - It("return error", func() { + It("Flavor/Memory Conflict", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "--flavor", "C1_1X1X100", "-m", "1024") Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("Incorrect Usage: '[-m|--memory]', '[--flavor]' are exclusive.")) }) - }) - Context("VS create with incorrect parameters", func() { - It("return error", func() { + It("Flavor/Dedicated Conflict", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "--flavor", "C1_1X1X100", "--dedicated") Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("Incorrect Usage: '[--dedicated]', '[--flavor]' are exclusive.")) }) - }) - Context("VS create with incorrect parameters", func() { - It("return error", func() { + It("Flavor/Host Conflict", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "--flavor", "C1_1X1X100", "--host-id", "12345") Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("Incorrect Usage: '[--host-id]', '[--flavor]' are exclusive.")) }) - }) - Context("VS create with incorrect parameters", func() { - It("return error", func() { + It("OS/Image Conflict", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "-o", "CENTOS", "--image", "111") Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("Incorrect Usage: '[-o|--os]', '[--image]' are exclusive.")) }) - }) - Context("VS create with incorrect parameters", func() { - It("return error", func() { + It("Billing Conflict", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "--billing", "yearly") Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("Incorrect Usage: [--billing] billing rate must be either hourly or monthly.")) }) - }) - Context("VS create with incorrect parameters", func() { - It("return error", func() { + It("UserData/UserFile Conflict", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "-u", "CENTOS", "-F", "/tmp/file") Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("Incorrect Usage: '[-u|--userdata]', '[-F|--userfile]' are exclusive.")) }) - }) - Context("VS create with incorrect parameters", func() { - BeforeEach(func() { - fakeUI.Inputs("yes", "") - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, errors.New("Incorrect Usage: [-H|--hostname] is required.")) - }) - It("return error", func() { - err := testhelpers.RunCobraCommand(cliCommand.Command, "-o", "CENTOS") - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("Incorrect Usage: [-H|--hostname]")) - }) - }) - Context("VS create with incorrect parameters", func() { - BeforeEach(func() { - fakeUI.Inputs("yes", "") - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, errors.New("Incorrect Usage: [-D|--domain] is required.")) - }) - It("return error", func() { - err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc") - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("Incorrect Usage: [-D|--domain]")) - }) - }) - Context("VS create with incorrect parameters", func() { - BeforeEach(func() { - fakeUI.Inputs("yes", "") - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, errors.New("Incorrect Usage: [-c|--cpu] is required and must be positive integer.")) - }) - It("return error", func() { - err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com") - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("Incorrect Usage: [-c|--cpu] is required and must be positive integer.")) - }) - }) - Context("VS create with incorrect parameters", func() { - BeforeEach(func() { - fakeUI.Inputs("yes", "") - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, errors.New("Incorrect Usage: [-m|--memory] is required and must be positive integer.")) - }) - It("return error", func() { - err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "-c", "2") - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("Incorrect Usage: [-m|--memory] is required and must be positive integer.")) - }) - }) - Context("VS create with incorrect parameters", func() { - BeforeEach(func() { - fakeUI.Inputs("yes", "") - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, errors.New("Incorrect Usage: [--datacenter] is required.")) - }) - It("return error", func() { - err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "-c", "2", "-m", "4096") - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("Incorrect Usage: [--datacenter] is required.")) - }) - }) - Context("VS create with incorrect parameters", func() { - BeforeEach(func() { - fakeUI.Inputs("yes", "") - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, errors.New("Incorrect Usage: either [-o|--os] or [--image] is required.")) - }) - It("return error", func() { - err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "-c", "2", "-m", "4096", "--datacenter", "dal10") - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("Incorrect Usage: either [-o|--os] or [--image] is required.")) - }) - }) - Context("VS create with incorrect parameters", func() { - BeforeEach(func() { - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, errors.New("Incorrect Usage: Template file: /abc/def/tmplate does not exist.")) - }) - It("return error", func() { - err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "-c", "2", "-m", "4096", "--datacenter", "dal10", "-o", "CENTOS", "--template", "/abc/def/tmplate") - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("Incorrect Usage: Template file: /abc/def/tmplate does not exist.")) - }) - }) - Context("VS create with incorrect parameters", func() { - BeforeEach(func() { - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, errors.New("Incorrect Usage: Local disk number cannot excceed two.")) - }) - It("return error", func() { - err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "-c", "2", "-m", "4096", "--datacenter", "dal10", "-o", "CENTOS", "--disk", "100", "--disk", "100", "--disk", "100") + It("SAN/Local Conflict", func() { + err := testhelpers.RunCobraCommand(cliCommand.Command, "--san", "--local") Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("Incorrect Usage: Local disk number cannot excceed two.")) + Expect(err.Error()).To(ContainSubstring("[local san] were all set")) }) }) - Context("VS create with incorrect parameters", func() { - BeforeEach(func() { - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, errors.New("Incorrect Usage: San disk number cannot excceed five.")) - }) - It("return error", func() { - err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "-c", "2", "-m", "4096", "--datacenter", "dal10", "-o", "CENTOS", "--san", "--disk", "100", "--disk", "100", "--disk", "100", "--disk", "100", "--disk", "100", "--disk", "100") - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("Incorrect Usage: San disk number cannot excceed five.")) - }) - }) - - Context("VS create with --export fails", func() { - BeforeEach(func() { - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, nil) - }) - It("return error", func() { + Context("VS create with --export", func() { + It("Failed to write file", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "-c", "2", "-m", "4096", "--datacenter", "dal10", "-o", "CENTOS", "--export", "/root/template") Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("Failed to write virtual server template file to: /root/template.")) }) - }) - Context("VS create with --export succeed", func() { - BeforeEach(func() { - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, nil) - - }) - It("return no error", func() { + It("Success", func() { tmpFile, tmpErr := ioutil.TempFile(os.TempDir(), "create_tests-") if tmpErr != nil { Skip("Cannot create temporary file") @@ -212,36 +115,23 @@ var _ = Describe("VS create", func() { Expect(fakeUI.Outputs()).To(ContainSubstring("Virtual server template is exported to: " + fileName + ".")) }) }) - - Context("VS create with --test fails", func() { - BeforeEach(func() { - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, nil) + Context("VS create with --test", func() { + It("API Error", func() { fakeVSManager.VerifyInstanceCreationReturns(datatypes.Container_Product_Order{}, errors.New("Internal Server Error")) - }) - It("return error", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "-c", "2", "-m", "4096", "--datacenter", "dal10", "-o", "CENTOS", "--test") Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("Failed to verify virtual server creation.")) Expect(err.Error()).To(ContainSubstring("Internal Server Error")) }) - }) - Context("VS create with --test succeed", func() { - BeforeEach(func() { - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, nil) + It("Success", func() { fakeVSManager.VerifyInstanceCreationReturns(datatypes.Container_Product_Order{}, nil) - }) - It("return error", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "-c", "2", "-m", "4096", "--datacenter", "dal10", "-o", "CENTOS", "--test") Expect(err).NotTo(HaveOccurred()) Expect(fakeUI.Outputs()).To(ContainSubstring("OK")) Expect(fakeUI.Outputs()).To(ContainSubstring("The order is correct.")) }) }) - Context("Check for -s and -S from #3489", func() { - BeforeEach(func() { - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, nil) - fakeVSManager.VerifyInstanceCreationReturns(datatypes.Container_Product_Order{}, nil) - }) + Context("Check for -s and -S", func() { It("Make sure -S sets public-security-group", func() { err1 := testhelpers.RunCobraCommand(cliCommand.Command, "--hostname", "vs111abc", "-D", "wilma1.com", "--flavor", "C1_1X1X100", "--datacenter", "dal10", "-o", "CENTOS", "-S", "9999", "--test") Expect(err1).NotTo(HaveOccurred()) @@ -256,48 +146,22 @@ var _ = Describe("VS create", func() { Expect(call1["private-security-group"]).To(Equal([]int{9999})) }) }) - - Context("VS create without -f and not continue", func() { - BeforeEach(func() { - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, nil) - fakeVSManager.VerifyInstanceCreationReturns(datatypes.Container_Product_Order{}, errors.New("Internal Server Error")) - }) - It("return error", func() { + Context("VS create -f", func() { + It("Aborted", func() { fakeUI.Inputs("No") err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "-c", "2", "-m", "4096", "--datacenter", "dal10", "-o", "CENTOS") Expect(err).NotTo(HaveOccurred()) Expect(fakeUI.Outputs()).To(ContainSubstring("This action will incur charges on your account. Continue?")) Expect(fakeUI.Outputs()).To(ContainSubstring("Aborted.")) }) - }) - - Context("VS create with -f but server fails", func() { - BeforeEach(func() { - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, nil) - fakeVSManager.VerifyInstanceCreationReturns(datatypes.Container_Product_Order{}, errors.New("Internal Server Error")) + It("API Error", func() { fakeVSManager.CreateInstanceReturns(datatypes.Virtual_Guest{}, errors.New("Internal Server Error")) - }) - It("return error", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "-c", "2", "-m", "4096", "--datacenter", "dal10", "-o", "CENTOS", "-f") Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("Failed to create virtual server instance.")) Expect(err.Error()).To(ContainSubstring("Internal Server Error")) }) - }) - - Context("VS create with -f and succeed", func() { - BeforeEach(func() { - created, _ := time.Parse(time.RFC3339, "2017-01-03T00:00:00Z") - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, nil) - fakeVSManager.VerifyInstanceCreationReturns(datatypes.Container_Product_Order{}, errors.New("Internal Server Error")) - fakeVSManager.CreateInstanceReturns(datatypes.Virtual_Guest{ - Id: sl.Int(1234), - FullyQualifiedDomainName: sl.String("vs-abc.wilma.com"), - GlobalIdentifier: sl.String("dhtyengodyhebt"), - CreateDate: sl.Time(created), - }, nil) - }) - It("return error", func() { + It("Success", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "-c", "2", "-m", "4096", "--datacenter", "dal10", "-o", "CENTOS", "-f") Expect(err).NotTo(HaveOccurred()) Expect(fakeUI.Outputs()).To(ContainSubstring("1234")) @@ -306,21 +170,9 @@ var _ = Describe("VS create", func() { Expect(fakeUI.Outputs()).To(ContainSubstring("dhtyengodyhebt")) }) }) - - Context("VS create with succeed but set tag fails", func() { - BeforeEach(func() { - created, _ := time.Parse(time.RFC3339, "2017-01-03T00:00:00Z") - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, nil) - fakeVSManager.VerifyInstanceCreationReturns(datatypes.Container_Product_Order{}, nil) - fakeVSManager.CreateInstanceReturns(datatypes.Virtual_Guest{ - Id: sl.Int(1234), - FullyQualifiedDomainName: sl.String("vs-abc.wilma.com"), - GlobalIdentifier: sl.String("dhtyengodyhebt"), - CreateDate: sl.Time(created), - }, nil) - fakeVSManager.SetTagsReturns(errors.New("Internal Server Error")) - }) + Context("VS create with tags", func() { It("return error", func() { + fakeVSManager.SetTagsReturns(errors.New("Internal Server Error")) err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "-c", "2", "-m", "4096", "--datacenter", "dal10", "-o", "CENTOS", "-f", "--tag", "mytag") Expect(err).To(HaveOccurred()) Expect(fakeUI.Outputs()).To(ContainSubstring("1234")) @@ -331,21 +183,9 @@ var _ = Describe("VS create", func() { Expect(strings.Contains(err.Error(), "Internal Server Error")) }) }) - Context("VS create with succeed but get ready fails", func() { - BeforeEach(func() { - created, _ := time.Parse(time.RFC3339, "2017-01-03T00:00:00Z") - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, nil) - fakeVSManager.VerifyInstanceCreationReturns(datatypes.Container_Product_Order{}, nil) - fakeVSManager.CreateInstanceReturns(datatypes.Virtual_Guest{ - Id: sl.Int(1234), - FullyQualifiedDomainName: sl.String("vs-abc.wilma.com"), - GlobalIdentifier: sl.String("dhtyengodyhebt"), - CreateDate: sl.Time(created), - }, nil) + It("Read API Error", func() { fakeVSManager.InstanceIsReadyReturns(false, "", errors.New("Internal Server Error")) - }) - It("return error", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "-c", "2", "-m", "4096", "--datacenter", "dal10", "-o", "CENTOS", "-f", "--wait", "1") Expect(err).To(HaveOccurred()) Expect(fakeUI.Outputs()).To(ContainSubstring("1234")) @@ -356,21 +196,8 @@ var _ = Describe("VS create", func() { Expect(strings.Contains(err.Error(), "Internal Server Error")) }) }) - - Context("VS create succeed and get ready succeed", func() { - BeforeEach(func() { - created, _ := time.Parse(time.RFC3339, "2017-01-03T00:00:00Z") - fakeVSManager.GenerateInstanceCreationTemplateReturns(&datatypes.Virtual_Guest{}, nil) - fakeVSManager.VerifyInstanceCreationReturns(datatypes.Container_Product_Order{}, nil) - fakeVSManager.CreateInstanceReturns(datatypes.Virtual_Guest{ - Id: sl.Int(1234), - FullyQualifiedDomainName: sl.String("vs-abc.wilma.com"), - GlobalIdentifier: sl.String("dhtyengodyhebt"), - CreateDate: sl.Time(created), - }, nil) - fakeVSManager.InstanceIsReadyReturns(true, "", nil) - }) - It("return no error", func() { + Context("Happy Path", func() { + It("Created with ready check", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "-c", "2", "-m", "4096", "--datacenter", "dal10", "-o", "CENTOS", "-f", "--wait", "1") Expect(err).NotTo(HaveOccurred()) Expect(fakeUI.Outputs()).To(ContainSubstring("1234")) @@ -379,7 +206,7 @@ var _ = Describe("VS create", func() { Expect(fakeUI.Outputs()).To(ContainSubstring("dhtyengodyhebt")) Expect(fakeUI.Outputs()).To(ContainSubstring("true")) }) - It("return no error", func() { + It("Created", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "-H", "vs-abc", "-D", "wilma.com", "--flavor", "M1_1X8X100", "--datacenter", "dal10", "-o", "CENTOS", "-f") Expect(err).NotTo(HaveOccurred()) Expect(fakeUI.Outputs()).To(ContainSubstring("1234")) @@ -387,6 +214,18 @@ var _ = Describe("VS create", func() { Expect(fakeUI.Outputs()).To(ContainSubstring("2017-01-03T00:00:00Z")) Expect(fakeUI.Outputs()).To(ContainSubstring("dhtyengodyhebt")) }) + It("Test setting local flag", func() { + err := testhelpers.RunCobraCommand(cliCommand.Command, "--local", "-f", "-H=vs-abc", "-D=wilma.com", "--flavor=SOME_FLAVOR", "--datacenter=dal10", "-o=CENTOS") + Expect(err).NotTo(HaveOccurred()) + _, vsTemplate := fakeVSManager.GenerateInstanceCreationTemplateArgsForCall(0) + Expect(vsTemplate["san"]).To(BeFalse()) + }) + It("Test setting san flag", func() { + err := testhelpers.RunCobraCommand(cliCommand.Command, "--san", "-f", "-H=vs-abc", "-D=wilma.com", "--flavor=SOME_FLAVOR", "--datacenter=dal10", "-o=CENTOS") + Expect(err).NotTo(HaveOccurred()) + _, vsTemplate := fakeVSManager.GenerateInstanceCreationTemplateArgsForCall(0) + Expect(vsTemplate["san"]).To(BeTrue()) + }) }) }) }) diff --git a/plugin/i18n/v2Resources/active.de_DE.json b/plugin/i18n/v2Resources/active.de_DE.json index dea9c470..93bc94c7 100644 --- a/plugin/i18n/v2Resources/active.de_DE.json +++ b/plugin/i18n/v2Resources/active.de_DE.json @@ -269,8 +269,8 @@ "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n This command finds the IP address record with IP address 9.125.235.255 and displays its subnet and device information.": { "other": "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONEN]\n\t\nBEISPIEL: \n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n Dieser Befehl sucht nach dem IP-Adressdatensatz mit der IP-Adresse 9.125.235.255 und zeigt sein Teilnetz und die Gerätedaten an." }, - "${COMMAND_NAME} sl tags set [OPTIONS]\n\nEXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { - "other": "${COMMAND_NAME} sl tags set [OPTIONEN]\n\nBEISPIEL:\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" + "EXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { + "other": "BEISPIEL:\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" }, "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \nEXAMPLE:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 ": { "other": "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONEN]\n \nBeispiel: \n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 " @@ -320,8 +320,8 @@ "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n This command captures virtual server instance with ID of 12345678 with all disks into an image named \"mycloud\" with note \"testing\".": { "other": "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONEN]\n\t\nBEISPIEL:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n Dieser Befehl erfasst die virtuelle Serverinstanz mit der ID 12345678 mit allen Platten in ein Image mit dem Namen \"mycloud\" und der Anmerkung \"testing\"." }, - "${COMMAND_NAME} sl vs create [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { - "other": "${COMMAND_NAME} sl vs create [OPTIONEN]\n\t\nBEISPIEL:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tDieser Befehl fordert eine virtuelle Serverinstanz mit dem Hostnamen myvsi, der Domäne ibm.com, 4 CPU-Cores, 4096 M Speicher und Position im Rechenzentrum dal10 an,\n\tBetriebssystem ist UBUNTU 16 64-Bit, 2 Platten, die eine mit 100 G, die andere mit 1000 G und Position im öffentlichen VLAN mit der ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tDieser Befehl testet, ob die Bestellung mit den obigen Optionen gültig ist, bevor die Anforderung tatsächlich aufgegeben wird.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tDieser Befehl exportiert die obigen Optionen in die Datei myvsi.txt unter dem Benutzerausgangsverzeichnis für die spätere Verwendung." + "EXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { + "other": "BEISPIEL:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tDieser Befehl fordert eine virtuelle Serverinstanz mit dem Hostnamen myvsi, der Domäne ibm.com, 4 CPU-Cores, 4096 M Speicher und Position im Rechenzentrum dal10 an,\n\tBetriebssystem ist UBUNTU 16 64-Bit, 2 Platten, die eine mit 100 G, die andere mit 1000 G und Position im öffentlichen VLAN mit der ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tDieser Befehl testet, ob die Bestellung mit den obigen Optionen gültig ist, bevor die Anforderung tatsächlich aufgegeben wird.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tDieser Befehl exportiert die obigen Optionen in die Datei myvsi.txt unter dem Benutzerausgangsverzeichnis für die spätere Verwendung." }, "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n Note: If you don't specify any arguments, it will attempt to update both the A\n and PTR records. If you don't want to update both records, you may use the\n -a or --ptr arguments to limit the records updated.\n \nEXAMPLE:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n This command synchronizes A record(IP V4 address) of virtual server instance with ID 12345678 to DNS server and sets ttl of this A record to 3600.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n This command synchronizes both AAAA record(IP V6 address) and PTR record of virtual server instance with ID 12345678 to DNS server.": { "other": "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONEN]\n Hinweis: Wenn Sie keine Argumente angeben, wird versucht, sowohl die A-\n als auch die PTR-Datensätze zu aktualisieren. Wenn nicht beide Datensätze aktualisiert werden sollen, können Sie die\n Argumente -a oder --ptr verwenden, um die aktualisierten Datensätze einzugrenzen.\n \nBEISPIEL:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n Dieser Befehl synchronisiert den A-Datensatz (IPv4-Adresse) der virtuellen Serverinstanz mit der ID 12345678 mit dem DNS-Server und legt das TTL dieses A-Datensatzes auf 3600 fest.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n Dieser Befehl synchronisiert sowohl den AAAA-Datensatz (IPv6-Adresse) als auch den PTR-Datensatz der virtuellen Serverinstanz mit der ID 12345678 mit dem DNS-Server." @@ -1376,8 +1376,8 @@ "Comma separated list of tags, enclosed in quotes. 'tag1, tag2'": { "other": "Liste mit durch Kommas getrennten Tags, eingeschlossen in Anführungszeichen. 'tag1, tag2'" }, - "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2' [required]": { - "other": "Liste mit durch Kommas getrennten Tags, eingeschlossen in Anführungszeichen. 'tag1,tag2' [erforderlich]" + "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2'": { + "other": "Liste mit durch Kommas getrennten Tags, eingeschlossen in Anführungszeichen. 'tag1,tag2'" }, "Company": { "other": "Firma" @@ -3821,8 +3821,8 @@ "ID of an origin volume snapshot to use for duplication": { "other": "ID eines Ursprungsdatenträgersnapshots zur Verwendung für die Duplizierung" }, - "ID of the object being tagged [required]": { - "other": "ID des Objekts, das mit Tags versehen wird [erforderlich]" + "ID of the object being tagged": { + "other": "ID des Objekts, das mit Tags versehen wird" }, "IDENTIFIER": { "other": "ID" @@ -4097,8 +4097,8 @@ "Key Name": { "other": "Schlüsselname" }, - "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output. [required]": { - "other": "Schlüsselname eines Tagtyps, z. B. GUEST, HARDWARE. Siehe 'slcli tags taggable'-Ausgabe. [erforderlich]" + "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output.": { + "other": "Schlüsselname eines Tagtyps, z. B. GUEST, HARDWARE. Siehe 'slcli tags taggable'-Ausgabe." }, "Key name. It's only available in HEADER or COOKIE type": { "other": "Schlüsselname. Nur im Typ HEADER oder COOKIE verfügbar." @@ -7295,8 +7295,8 @@ "[TAG NAME]": { "other": "[TAGNAME]" }, - "[required]": { - "other": "[erforderlich]" + "required": { + "other": "erforderlich" }, "accepts at most {{.Limit}} arg(s), received {{.Args}}": { "other": "akzeptiert höchstens {{.Limit}} Argument(e), empfangen {{.Args}}" diff --git a/plugin/i18n/v2Resources/active.en-US.json b/plugin/i18n/v2Resources/active.en-US.json index d9029c5a..6d829369 100644 --- a/plugin/i18n/v2Resources/active.en-US.json +++ b/plugin/i18n/v2Resources/active.en-US.json @@ -278,9 +278,6 @@ "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n This command finds the IP address record with IP address 9.125.235.255 and displays its subnet and device information.": { "other": "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n This command finds the IP address record with IP address 9.125.235.255 and displays its subnet and device information." }, - "${COMMAND_NAME} sl tags set [OPTIONS]\n\nEXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { - "other": "${COMMAND_NAME} sl tags set [OPTIONS]\n\nEXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" - }, "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \nEXAMPLE:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 ": { "other": "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \nEXAMPLE:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 " }, @@ -329,9 +326,6 @@ "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n This command captures virtual server instance with ID of 12345678 with all disks into an image named \"mycloud\" with note \"testing\".": { "other": "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n This command captures virtual server instance with ID of 12345678 with all disks into an image named \"mycloud\" with note \"testing\"." }, - "${COMMAND_NAME} sl vs create [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { - "other": "${COMMAND_NAME} sl vs create [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use." - }, "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n Note: If you don't specify any arguments, it will attempt to update both the A\n and PTR records. If you don't want to update both records, you may use the\n -a or --ptr arguments to limit the records updated.\n \nEXAMPLE:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n This command synchronizes A record(IP V4 address) of virtual server instance with ID 12345678 to DNS server and sets ttl of this A record to 3600.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n This command synchronizes both AAAA record(IP V6 address) and PTR record of virtual server instance with ID 12345678 to DNS server.": { "other": "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n Note: If you don't specify any arguments, it will attempt to update both the A\n and PTR records. If you don't want to update both records, you may use the\n -a or --ptr arguments to limit the records updated.\n \nEXAMPLE:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n This command synchronizes A record(IP V4 address) of virtual server instance with ID 12345678 to DNS server and sets ttl of this A record to 3600.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n This command synchronizes both AAAA record(IP V6 address) and PTR record of virtual server instance with ID 12345678 to DNS server." }, @@ -1367,8 +1361,8 @@ "Comma separated list of tags, enclosed in quotes. 'tag1, tag2'": { "other": "Comma separated list of tags, enclosed in quotes. 'tag1, tag2'" }, - "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2' [required]": { - "other": "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2' [required]" + "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2'": { + "other": "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2'" }, "Company": { "other": "Company" @@ -1886,6 +1880,12 @@ "Duplicate Volume Properties": { "other": "Duplicate Volume Properties" }, + "EXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { + "other": "EXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" + }, + "EXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { + "other": "EXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use." + }, "EXAMPLE:\n ${COMMAND_NAME} sl {{.storageType}} access-authorize 12345678 --virtual-id 87654321\n This command authorizes virtual server with ID 87654321 to access volume with ID 12345678.": { "other": "EXAMPLE:\n ${COMMAND_NAME} sl {{.storageType}} access-authorize 12345678 --virtual-id 87654321\n This command authorizes virtual server with ID 87654321 to access volume with ID 12345678." }, @@ -3857,8 +3857,8 @@ "ID of an origin volume snapshot to use for duplication": { "other": "ID of an origin volume snapshot to use for duplication" }, - "ID of the object being tagged [required]": { - "other": "ID of the object being tagged [required]" + "ID of the object being tagged": { + "other": "ID of the object being tagged" }, "IDENTIFIER": { "other": "IDENTIFIER" @@ -3998,6 +3998,9 @@ "Incorrect Usage: ": { "other": "Incorrect Usage: " }, + "Incorrect Usage: '{{.CMD}}' is required": { + "other": "Incorrect Usage: '{{.CMD}}' is required" + }, "Incorrect complex type: {{.Type}}": { "other": "Incorrect complex type: {{.Type}}" }, @@ -4142,8 +4145,8 @@ "Key Name": { "other": "Key Name" }, - "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output. [required]": { - "other": "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output. [required]" + "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output.": { + "other": "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output." }, "Key name. It's only available in HEADER or COOKIE type": { "other": "Key name. It's only available in HEADER or COOKIE type" @@ -7130,6 +7133,9 @@ "Use `${COMMAND_NAME} sl order lookup ` to find more details about a specific order.": { "other": "Use `${COMMAND_NAME} sl order lookup ` to find more details about a specific order." }, + "Use local disk storage.": { + "other": "Use local disk storage." + }, "Use the configuration from an existing virtual server": { "other": "Use the configuration from an existing virtual server" }, @@ -7742,6 +7748,9 @@ "replication": { "other": "replication" }, + "required": { + "other": "required" + }, "requires at least {{.Limit}} arg(s), only received {{.Args}}": { "other": "requires at least {{.Limit}} arg(s), only received {{.Args}}" }, @@ -7802,9 +7811,6 @@ "type": { "other": "type" }, - "unknown command {{.Arg}} for {{.Command}}": { - "other": "unknown command {{.Arg}} for {{.Command}}" - }, "updated": { "other": "updated" }, diff --git a/plugin/i18n/v2Resources/active.es_ES.json b/plugin/i18n/v2Resources/active.es_ES.json index 93fe6f4a..ec2e5fff 100644 --- a/plugin/i18n/v2Resources/active.es_ES.json +++ b/plugin/i18n/v2Resources/active.es_ES.json @@ -269,8 +269,8 @@ "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n This command finds the IP address record with IP address 9.125.235.255 and displays its subnet and device information.": { "other": "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\nEJEMPLO:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n Este mandato encuentra el registro de dirección IP con la dirección IP 9.125.235.255 y muestra la información del dispositivo y la subred." }, - "${COMMAND_NAME} sl tags set [OPTIONS]\n\nEXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { - "other": "${COMMAND_NAME} sl tags set [OPTIONS]\n\nEJEMPLO:\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" + "EXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { + "other": "EJEMPLO:\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" }, "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \nEXAMPLE:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 ": { "other": "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \nEJEMPLO:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 " @@ -320,8 +320,8 @@ "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n This command captures virtual server instance with ID of 12345678 with all disks into an image named \"mycloud\" with note \"testing\".": { "other": "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\nEJEMPLO:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n Este mandato captura la instancia de servidor virtual con el ID de 12345678 con todos los discos en una imagen denominada \"mycloud\" con la nota \"testing\"." }, - "${COMMAND_NAME} sl vs create [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { - "other": "${COMMAND_NAME} sl vs create [OPTIONS]\n\t\nEJEMPLO:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tEste mandato solicita una instancia de servidor virtual cuyo nombre de host es myvsi, el dominio es ibm.com, 4 núcleos de cpu, 4096M de memoria, ubicada en el centro de datos: dal10,\n\tel sistema operativo es UBUNTU 16 de 64 bits, 2 discos, uno es 100G, el otro es 1000G, y está ubicado en la vlan pública con el ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tEste mandato prueba si el pedido es válido con las opciones anteriores antes de realizarlo.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tEste mandato exporta las opciones anterior a un archivo: myvsi.txt bajo el directorio de inicio del usuario para que se pueda utilizar posteriormente." + "EXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { + "other": "EJEMPLO:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tEste mandato solicita una instancia de servidor virtual cuyo nombre de host es myvsi, el dominio es ibm.com, 4 núcleos de cpu, 4096M de memoria, ubicada en el centro de datos: dal10,\n\tel sistema operativo es UBUNTU 16 de 64 bits, 2 discos, uno es 100G, el otro es 1000G, y está ubicado en la vlan pública con el ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tEste mandato prueba si el pedido es válido con las opciones anteriores antes de realizarlo.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tEste mandato exporta las opciones anterior a un archivo: myvsi.txt bajo el directorio de inicio del usuario para que se pueda utilizar posteriormente." }, "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n Note: If you don't specify any arguments, it will attempt to update both the A\n and PTR records. If you don't want to update both records, you may use the\n -a or --ptr arguments to limit the records updated.\n \nEXAMPLE:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n This command synchronizes A record(IP V4 address) of virtual server instance with ID 12345678 to DNS server and sets ttl of this A record to 3600.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n This command synchronizes both AAAA record(IP V6 address) and PTR record of virtual server instance with ID 12345678 to DNS server.": { "other": "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n Nota: Si no especifica ningún argumento, intentará actualizar los registros A\n y PTR. Si no quiere actualizar ambos registros, podría utilizar los argumentos\n -a o --ptr para limitar los registros actualizados.\n \nEJEMPLO:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n Este mandato sincroniza un registro A (dirección IP V4) de la instancia de servidor virtual con el ID 12345678 con el servidor DNS y establece el ttl de este registro A en 3600.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n Este mandato sincroniza ambos registros AAAA (dirección IP V6) y el registro PTR de la instancia de servidor virtual con el ID 12345678 con el servidor DNS." @@ -1376,8 +1376,8 @@ "Comma separated list of tags, enclosed in quotes. 'tag1, tag2'": { "other": "Lista de etiquetas separadas por comas, entre comillas. 'tag1, tag2'" }, - "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2' [required]": { - "other": "Lista de etiquetas separadas por comas, entre comillas. 'etiqueta1,etiqueta2' [obligatorio]" + "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2'": { + "other": "Lista de etiquetas separadas por comas, entre comillas. 'etiqueta1,etiqueta2'" }, "Company": { "other": "Empresa" @@ -3821,8 +3821,8 @@ "ID of an origin volume snapshot to use for duplication": { "other": "ID de la instantánea de volumen origen a utilizar para la duplicación" }, - "ID of the object being tagged [required]": { - "other": "ID del objeto que se está etiquetando [obligatorio]" + "ID of the object being tagged": { + "other": "ID del objeto que se está etiquetando" }, "IDENTIFIER": { "other": "IDENTIFIER" @@ -4097,8 +4097,8 @@ "Key Name": { "other": "Nombre de clave" }, - "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output. [required]": { - "other": "Nombre de clave de un tipo de etiqueta, por ejemplo, INVITADO, HARDWARE. Consulte la salida de etiquetas de las etiquetas slcli. [obligatorio]" + "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output.": { + "other": "Nombre de clave de un tipo de etiqueta, por ejemplo, INVITADO, HARDWARE. Consulte la salida de etiquetas de las etiquetas slcli." }, "Key name. It's only available in HEADER or COOKIE type": { "other": "Nombre de clave. Solo está disponible en el tipo HEADER o COOKIE" @@ -7295,8 +7295,8 @@ "[TAG NAME]": { "other": "[TAG NAME]" }, - "[required]": { - "other": "[obligatorio]" + "required": { + "other": "obligatorio" }, "accepts at most {{.Limit}} arg(s), received {{.Args}}": { "other": "acepta un máximo de {{.Limit}} argumentos, recibidos {{.Args}}" diff --git a/plugin/i18n/v2Resources/active.fr_FR.json b/plugin/i18n/v2Resources/active.fr_FR.json index 42ebe11f..885def8c 100644 --- a/plugin/i18n/v2Resources/active.fr_FR.json +++ b/plugin/i18n/v2Resources/active.fr_FR.json @@ -269,8 +269,8 @@ "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n This command finds the IP address record with IP address 9.125.235.255 and displays its subnet and device information.": { "other": "${COMMAND_NAME} sl subnet lookup ADRESSE_IP [OPTIONS]\n\t\nEXEMPLE :\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n Cette commande recherche l'enregistrement d'adresse IP avec l'adresse IP 9.125.235.255 et affiche les informations sur son sous-réseau et ses périphériques." }, - "${COMMAND_NAME} sl tags set [OPTIONS]\n\nEXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { - "other": "${COMMAND_NAME} sl tags set [OPTIONS]\n\nEXEMPLE :\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" + "EXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { + "other": "EXEMPLE :\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" }, "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \nEXAMPLE:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 ": { "other": "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \nEXEMPLE :\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 " @@ -320,8 +320,8 @@ "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n This command captures virtual server instance with ID of 12345678 with all disks into an image named \"mycloud\" with note \"testing\".": { "other": "${COMMAND_NAME} sl vs capture IDENTIFICATEUR [OPTIONS]\n\nEXEMPLE :\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n Cette commande capture l'instance de serveur virtuel dont l'ID est 12345678 avec tous les disques dans une image nommée \"mycloud\" avec la note \"testing\"." }, - "${COMMAND_NAME} sl vs create [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { - "other": "${COMMAND_NAME} sl vs create [OPTIONS]\n\nEXEMPLE :\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\nCette commande commande une instance de serveur virtuel avec le nom d'hôte myvsi, le domaine ibm.com, 4 coeurs d'UC, 4096 Mo de mémoire, situé dans le centre de données dal10,\nsystème d'exploitation UBUNTU 16 64 bits, 2 disques (un de 100 Go et l'autre de 1000 Go) situé sur le réseau local virtuel public avec l'ID 413.\n${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\nCette commande teste la validité de la commande par rapport aux options ci-dessus avant de l'émettre.\n${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\nCette commande exporte les options ci-dessus dans un fichier myvsi.txt dans le répertoire personnel de l'utilisateur en vue d'une utilisation ultérieure." + "EXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { + "other": "EXEMPLE :\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\nCette commande commande une instance de serveur virtuel avec le nom d'hôte myvsi, le domaine ibm.com, 4 coeurs d'UC, 4096 Mo de mémoire, situé dans le centre de données dal10,\nsystème d'exploitation UBUNTU 16 64 bits, 2 disques (un de 100 Go et l'autre de 1000 Go) situé sur le réseau local virtuel public avec l'ID 413.\n${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\nCette commande teste la validité de la commande par rapport aux options ci-dessus avant de l'émettre.\n${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\nCette commande exporte les options ci-dessus dans un fichier myvsi.txt dans le répertoire personnel de l'utilisateur en vue d'une utilisation ultérieure." }, "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n Note: If you don't specify any arguments, it will attempt to update both the A\n and PTR records. If you don't want to update both records, you may use the\n -a or --ptr arguments to limit the records updated.\n \nEXAMPLE:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n This command synchronizes A record(IP V4 address) of virtual server instance with ID 12345678 to DNS server and sets ttl of this A record to 3600.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n This command synchronizes both AAAA record(IP V6 address) and PTR record of virtual server instance with ID 12345678 to DNS server.": { "other": "${COMMAND_NAME} sl vs dns-sync IDENTIFICATEUR [OPTIONS]\n Remarque : si vous n'indiquez aucun argument, la commande tente de mettre à jour les enregistrements A\n et PTR. Si vous ne souhaitez pas mettre à jour les deux enregistrements, vous pouvez utiliser l'argument\n -a ou --ptr pour limiter les enregistrements mis à jour.\n \nEXEMPLE :\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n Cette commande synchronise l'enregistrement A (adresse IP V4) de l'instance de serveur dont l'ID est 12345678 avec le serveur DNS et définit sa durée de vie sur 3600.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n Cette commande synchronise les enregistrements AAAA (adresse IP V6) et PTR de l'instance de serveur virtuel dont l'ID est 12345678 avec le serveur DNS." @@ -1376,8 +1376,8 @@ "Comma separated list of tags, enclosed in quotes. 'tag1, tag2'": { "other": "Liste d'étiquettes séparées par une virgule, entre guillemets. 'tag1, tag2'" }, - "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2' [required]": { - "other": "Liste d'étiquettes séparées par une virgule, entre guillemets. 'tag1,tag2' [requis]" + "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2'": { + "other": "Liste d'étiquettes séparées par une virgule, entre guillemets. 'tag1,tag2'" }, "Company": { "other": "Société" @@ -3821,8 +3821,8 @@ "ID of an origin volume snapshot to use for duplication": { "other": "ID d'une image instantanée de volume d'origine à utiliser pour la duplication" }, - "ID of the object being tagged [required]": { - "other": "ID de l'objet à étiqueter [requis]" + "ID of the object being tagged": { + "other": "ID de l'objet à étiqueter" }, "IDENTIFIER": { "other": "IDENTIFICATEUR" @@ -4097,8 +4097,8 @@ "Key Name": { "other": "Nom de la clé" }, - "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output. [required]": { - "other": "Nom clé d'un type d'étiquette, par exemple GUEST, HARDWARE Voir la sortie slcli tags taggable. [requis]" + "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output.": { + "other": "Nom clé d'un type d'étiquette, par exemple GUEST, HARDWARE Voir la sortie slcli tags taggable." }, "Key name. It's only available in HEADER or COOKIE type": { "other": "Nom de la clé. Uniquement disponible dans le type HEADER ou COOKIE" @@ -7295,8 +7295,8 @@ "[TAG NAME]": { "other": "[TAG NAME]" }, - "[required]": { - "other": "[obligatoire]" + "required": { + "other": "obligatoire" }, "accepts at most {{.Limit}} arg(s), received {{.Args}}": { "other": "doit recevoir au maximum {{.Limit}} argument(s), en a reçu {{.Args}}" diff --git a/plugin/i18n/v2Resources/active.it_IT.json b/plugin/i18n/v2Resources/active.it_IT.json index 874318be..2dc135a0 100644 --- a/plugin/i18n/v2Resources/active.it_IT.json +++ b/plugin/i18n/v2Resources/active.it_IT.json @@ -269,8 +269,8 @@ "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n This command finds the IP address record with IP address 9.125.235.255 and displays its subnet and device information.": { "other": "${COMMAND_NAME} sl subnet lookup INDIRIZZO_IP [OPZIONI]\n\t\nESEMPIO:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n Questo comando trova il record dell'indirizzo IP con l'indirizzo IP 9.125.235.255 e visualizza le informazioni relative a sottorete e dispositivo." }, - "${COMMAND_NAME} sl tags set [OPTIONS]\n\nEXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { - "other": "${COMMAND_NAME} sl tags set [OPZIONI]\n\nESEMPIO:\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" + "EXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { + "other": "ESEMPIO:\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" }, "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \nEXAMPLE:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 ": { "other": "${COMMAND_NAME} sl ticket attach IDTICKET [OPZIONI]\n \nESEMPIO:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 " @@ -320,8 +320,8 @@ "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n This command captures virtual server instance with ID of 12345678 with all disks into an image named \"mycloud\" with note \"testing\".": { "other": "${COMMAND_NAME} sl vs capture IDENTIFICATIVO [OPZIONI]\n\t\nESEMPIO:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n Questo comando acquisisce l'istanza del server virtuale con ID 12345678 con tutti i dischi in un'immagine denominata \"mycloud\" con nota \"testing\"." }, - "${COMMAND_NAME} sl vs create [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { - "other": "${COMMAND_NAME} sl vs create [OPZIONI]\n\t\nESEMPIO:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tQuesto comando ordina un'istanza del server virtuale con nome host myvsi, dominio ibm.com, 4 core cpu, 4096M di memoria, ubicata nel datacenter: dal10,\n\tcon sistema operativo UBUNTU 16 a 64 bit, 2 dischi, uno da 100G, l'altro da 1000G e ubicata nella vlan pubblica con ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tQuesto comando verifica se l'ordine è valido con le precedenti opzioni prima di posizionarlo effettivamente.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tQuesto comando esporta le precedenti opzioni in un file: myvsi.txt nella directory home per un utilizzo successivo." + "EXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { + "other": "ESEMPIO:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tQuesto comando ordina un'istanza del server virtuale con nome host myvsi, dominio ibm.com, 4 core cpu, 4096M di memoria, ubicata nel datacenter: dal10,\n\tcon sistema operativo UBUNTU 16 a 64 bit, 2 dischi, uno da 100G, l'altro da 1000G e ubicata nella vlan pubblica con ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tQuesto comando verifica se l'ordine è valido con le precedenti opzioni prima di posizionarlo effettivamente.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tQuesto comando esporta le precedenti opzioni in un file: myvsi.txt nella directory home per un utilizzo successivo." }, "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n Note: If you don't specify any arguments, it will attempt to update both the A\n and PTR records. If you don't want to update both records, you may use the\n -a or --ptr arguments to limit the records updated.\n \nEXAMPLE:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n This command synchronizes A record(IP V4 address) of virtual server instance with ID 12345678 to DNS server and sets ttl of this A record to 3600.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n This command synchronizes both AAAA record(IP V6 address) and PTR record of virtual server instance with ID 12345678 to DNS server.": { "other": "${COMMAND_NAME} sl vs dns-sync IDENTIFICATIVO [OPZIONI]\n Nota: se non specifichi alcun argomento, tenterà di aggiornare sia il record A\n che il PTR. Se non vuoi aggiornare entrambi i record, puoi utilizzare gli argomenti\n -a o --ptr per limitare i record aggiornati.\n \nESEMPIO:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n Questo comando sincronizza il record A (indirizzo IP V4) dell'istanza del server virtuale con ID 12345678 con il server DNS e imposta il ttl di tale record A su 3600.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n Questo comando sincronizza sia il record AAAA (indirizzo IP V6) che il record PTR dell'istanza del server virtuale con ID 12345678 con il server DNS." @@ -1376,8 +1376,8 @@ "Comma separated list of tags, enclosed in quotes. 'tag1, tag2'": { "other": "Elenco separato da virgole di tag, racchiusi tra virgolette. 'tag1, tag2'" }, - "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2' [required]": { - "other": "Elenco separato da virgole di tag, racchiusi tra virgolette. 'tag1,tag2' [obbligatorio]" + "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2'": { + "other": "Elenco separato da virgole di tag, racchiusi tra virgolette. 'tag1,tag2'" }, "Company": { "other": "Società" @@ -3821,8 +3821,8 @@ "ID of an origin volume snapshot to use for duplication": { "other": "ID di un'istantanea del volume di origine da utilizzare per la duplicazione" }, - "ID of the object being tagged [required]": { - "other": "ID dell'oggetto su cui si impostano tag [obbligatorio]" + "ID of the object being tagged": { + "other": "ID dell'oggetto su cui si impostano tag" }, "IDENTIFIER": { "other": "IDENTIFICATIVO" @@ -4097,8 +4097,8 @@ "Key Name": { "other": "Nome chiave" }, - "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output. [required]": { - "other": "Nome chiave di un tipo di tag, ad es. GUEST, HARDWARE. Vedere l'output di slcli tags taggable. [obbligatorio]" + "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output.": { + "other": "Nome chiave di un tipo di tag, ad es. GUEST, HARDWARE. Vedere l'output di slcli tags taggable." }, "Key name. It's only available in HEADER or COOKIE type": { "other": "Nome chiave. Disponibile solo nel tipo HEADER o COOKIE" @@ -7295,8 +7295,8 @@ "[TAG NAME]": { "other": "[NOME TAG]" }, - "[required]": { - "other": "[obbligatorio]" + "required": { + "other": "obbligatorio" }, "accepts at most {{.Limit}} arg(s), received {{.Args}}": { "other": "accetta al massimo {{.Limit}} arg, ricevuto {{.Args}}" diff --git a/plugin/i18n/v2Resources/active.ja_JP.json b/plugin/i18n/v2Resources/active.ja_JP.json index 8a1f750a..9b9738e7 100644 --- a/plugin/i18n/v2Resources/active.ja_JP.json +++ b/plugin/i18n/v2Resources/active.ja_JP.json @@ -269,8 +269,8 @@ "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n This command finds the IP address record with IP address 9.125.235.255 and displays its subnet and device information.": { "other": "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\n例:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n このコマンドは、IP アドレス 9.125.235.255 の IP アドレス・レコードを検出し、そのサブネットおよびデバイス情報を表示します。" }, - "${COMMAND_NAME} sl tags set [OPTIONS]\n\nEXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { - "other": "${COMMAND_NAME} sl tags set [OPTIONS]\n\n例:\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" + "EXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { + "other": "例:\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" }, "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \nEXAMPLE:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 ": { "other": "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \n例:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567" @@ -320,8 +320,8 @@ "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n This command captures virtual server instance with ID of 12345678 with all disks into an image named \"mycloud\" with note \"testing\".": { "other": "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\n例:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n このコマンドは、ID が 12345678 の Virtual Server インスタンスをすべてのディスクと共にキャプチャーして、「mycloud」という名前の、メモ「testing」が付いたイメージに入れます。" }, - "${COMMAND_NAME} sl vs create [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { - "other": "${COMMAND_NAME} sl vs create [OPTIONS]\n\n例:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\nこのコマンドは、Virtual Server インスタンスを注文します。それは、ホスト名が myvsi、ドメインが ibm.com、cpu コアが 4 つ、メモリーが 4096 M であり、データ・センター dal10 に置かれていて、\nオペレーション・システムは UBUNTU 16 64 ビット、ディスクは 2 個あり、1 つは 100 G、もう 1 つは 1000 G であり、ID 413 のパブリック vlan に置かれています。\n${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\nこのコマンドは、上のオプションでの注文が実際に行われる前に、このオーダーが有効かどうかをテストします。\n${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\nこのコマンドは、上のオプションを後で使用できるように、ユーザーのホーム・ディレクトリーの下にあるファイル myvsi.txt にエクスポートします。" + "EXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { + "other": "例:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\nこのコマンドは、Virtual Server インスタンスを注文します。それは、ホスト名が myvsi、ドメインが ibm.com、cpu コアが 4 つ、メモリーが 4096 M であり、データ・センター dal10 に置かれていて、\nオペレーション・システムは UBUNTU 16 64 ビット、ディスクは 2 個あり、1 つは 100 G、もう 1 つは 1000 G であり、ID 413 のパブリック vlan に置かれています。\n${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\nこのコマンドは、上のオプションでの注文が実際に行われる前に、このオーダーが有効かどうかをテストします。\n${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\nこのコマンドは、上のオプションを後で使用できるように、ユーザーのホーム・ディレクトリーの下にあるファイル myvsi.txt にエクスポートします。" }, "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n Note: If you don't specify any arguments, it will attempt to update both the A\n and PTR records. If you don't want to update both records, you may use the\n -a or --ptr arguments to limit the records updated.\n \nEXAMPLE:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n This command synchronizes A record(IP V4 address) of virtual server instance with ID 12345678 to DNS server and sets ttl of this A record to 3600.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n This command synchronizes both AAAA record(IP V6 address) and PTR record of virtual server instance with ID 12345678 to DNS server.": { "other": "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n 注: 引数が指定されていない場合、A レコードと PTR レコードの両方の更新が試行されます。\n 両方のレコードを更新したいのではない場合、\n -a 引数または --ptr 引数を使用して、更新されるレコードを制限できます。\n \n例:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n このコマンドは、ID 12345678 の Virtual Server インスタンスの A レコード (IP V4 アドレス) を DNS サーバーに同期し、この A レコードの ttl を 3600 に設定します。\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n このコマンドは、ID 12345678 の Virtual Server インスタンスの AAAA レコード (IP V6 アドレス) と PTR レコードの両方を DNS サーバーに同期します。" @@ -1376,8 +1376,8 @@ "Comma separated list of tags, enclosed in quotes. 'tag1, tag2'": { "other": "引用符で囲まれた、タグのコンマ区切りリスト。 'tag1, tag2'" }, - "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2' [required]": { - "other": "引用符で囲まれた、タグのコンマ区切りリスト。 'tag1,tag2' [必須]" + "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2'": { + "other": "引用符で囲まれた、タグのコンマ区切りリスト。 'tag1,tag2'" }, "Company": { "other": "会社" @@ -3821,8 +3821,8 @@ "ID of an origin volume snapshot to use for duplication": { "other": "複写用に使用する元のボリュームのスナップショットの ID" }, - "ID of the object being tagged [required]": { - "other": "タグ付けされるオブジェクトの ID [必須]" + "ID of the object being tagged": { + "other": "タグ付けされるオブジェクトの ID" }, "IDENTIFIER": { "other": "IDENTIFIER" @@ -4097,8 +4097,8 @@ "Key Name": { "other": "キー名" }, - "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output. [required]": { - "other": "タグ・タイプのキー名 (例: GUEST、HARDWARE)。 slcli タグのタグ付け可能出力を参照してください。[必須]" + "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output.": { + "other": "タグ・タイプのキー名 (例: GUEST、HARDWARE)。 slcli タグのタグ付け可能出力を参照してください。" }, "Key name. It's only available in HEADER or COOKIE type": { "other": "キー名。 これは、HEADER タイプまたは COOKIE タイプでのみ使用できます" @@ -7295,8 +7295,8 @@ "[TAG NAME]": { "other": "[タグ名]" }, - "[required]": { - "other": "[必須]" + "required": { + "other": "必須" }, "accepts at most {{.Limit}} arg(s), received {{.Args}}": { "other": "最大 {{.Limit}} arg (s), received {{.Args}} を受け入れます。" diff --git a/plugin/i18n/v2Resources/active.ko_KR.json b/plugin/i18n/v2Resources/active.ko_KR.json index 6b59ac8c..ec32beba 100644 --- a/plugin/i18n/v2Resources/active.ko_KR.json +++ b/plugin/i18n/v2Resources/active.ko_KR.json @@ -269,8 +269,8 @@ "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n This command finds the IP address record with IP address 9.125.235.255 and displays its subnet and device information.": { "other": "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [옵션]\n\n예:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n 이 명령은 IP 주소가 9.125.235.255인 IP 주소 레코드를 찾고 해당 서브넷과 디바이스 정보를 표시합니다." }, - "${COMMAND_NAME} sl tags set [OPTIONS]\n\nEXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { - "other": "${COMMAND_NAME} sl tags set [옵션]\n\n예:\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" + "EXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { + "other": "예:\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" }, "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \nEXAMPLE:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 ": { "other": "${COMMAND_NAME} sl ticket attach TICKETID [옵션]\n \n예:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 " @@ -320,8 +320,8 @@ "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n This command captures virtual server instance with ID of 12345678 with all disks into an image named \"mycloud\" with note \"testing\".": { "other": "${COMMAND_NAME} sl vs capture IDENTIFIER [옵션]\n\n예:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n 이 명령은 모든 디스크에서 ID 12345678인 가상 서버 인스턴스를 참고 \"testing\"의 이름이 \"mycloud\"인 이미지로 캡처합니다." }, - "${COMMAND_NAME} sl vs create [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { - "other": "${COMMAND_NAME} sl vs create [옵션]\n\n예:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n이 명령은 호스트 이름이 myvsi이고 도메인이 ibm.com이며 4개의 cpu 코어, 4096M 메모리를 포함하고 dal10 데이터 센터에 있으며 \n운영 체제가 UBUNTU 16 64비트이고 2개 디스크(1개는 100G, 다른 하나는 1000G)가 있으며 ID 413인 공용 VLAN에 있는 가상 서버 인스턴스를 주문합니다.\n${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n이 명령은 실제로 주문하기 전에 위의 옵션으로 주문이 올바른지 여부를 테스트합니다.\n${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n이 명령은 나중에 사용하기 위해 사용자 홈 디렉토리에 있는 myvsi.txt 파일로 상기 옵션을 내보냅니다." + "EXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { + "other": "예:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n이 명령은 호스트 이름이 myvsi이고 도메인이 ibm.com이며 4개의 cpu 코어, 4096M 메모리를 포함하고 dal10 데이터 센터에 있으며 \n운영 체제가 UBUNTU 16 64비트이고 2개 디스크(1개는 100G, 다른 하나는 1000G)가 있으며 ID 413인 공용 VLAN에 있는 가상 서버 인스턴스를 주문합니다.\n${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n이 명령은 실제로 주문하기 전에 위의 옵션으로 주문이 올바른지 여부를 테스트합니다.\n${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n이 명령은 나중에 사용하기 위해 사용자 홈 디렉토리에 있는 myvsi.txt 파일로 상기 옵션을 내보냅니다." }, "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n Note: If you don't specify any arguments, it will attempt to update both the A\n and PTR records. If you don't want to update both records, you may use the\n -a or --ptr arguments to limit the records updated.\n \nEXAMPLE:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n This command synchronizes A record(IP V4 address) of virtual server instance with ID 12345678 to DNS server and sets ttl of this A record to 3600.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n This command synchronizes both AAAA record(IP V6 address) and PTR record of virtual server instance with ID 12345678 to DNS server.": { "other": "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [옵션]\n 참고: 인수를 지정하지 않은 경우, 이는 A 및 PTR 레코드를 모두\n 업데이트하려고 시도합니다. 두 레코드를 모두 업데이트히지 않으려면 -a 또는\n --ptr 인수를 사용하여 업데이트된 레코드를 제한할 수 있습니다.\n \n예:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n 이 명령은 ID 12345678인 가상 서버 인스턴스의 A 레코드(IP V4 주소)를 DNS 서버에 동기화하고 이 A 레코드의 ttl을 3600으로 설정합니다.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n 이 명령은 ID 12345678인 가상 서버 인스턴스의 AAAA 레코드(IP V6 주소) 및 PTR 레코드를 모두 DNS 서버에 동기화합니다." @@ -1376,8 +1376,8 @@ "Comma separated list of tags, enclosed in quotes. 'tag1, tag2'": { "other": "따옴표로 묶인 쉼표로 구분된 태그 목록입니다. 'tag1, tag2'" }, - "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2' [required]": { - "other": "따옴표로 묶인 쉼표로 구분된 태그 목록입니다. 'tag1,tag2' [필수]" + "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2'": { + "other": "따옴표로 묶인 쉼표로 구분된 태그 목록입니다. 'tag1,tag2'" }, "Company": { "other": "회사" @@ -3821,8 +3821,8 @@ "ID of an origin volume snapshot to use for duplication": { "other": "복제에 사용할 원본 볼륨 스냅샷의 ID" }, - "ID of the object being tagged [required]": { - "other": "태그 지정되는 오브젝트의 ID입니다. [필수]" + "ID of the object being tagged": { + "other": "태그 지정되는 오브젝트의 ID입니다." }, "IDENTIFIER": { "other": "IDENTIFIER" @@ -4097,8 +4097,8 @@ "Key Name": { "other": "키 이름" }, - "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output. [required]": { - "other": "태그 유형의 키 이름입니다(예: GUEST, HARDWARE). slcli tags taggable 출력을 참조하십시오. [필수]" + "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output.": { + "other": "태그 유형의 키 이름입니다(예: GUEST, HARDWARE). slcli tags taggable 출력을 참조하십시오." }, "Key name. It's only available in HEADER or COOKIE type": { "other": "키 이름입니다. HEADER 또는 COOKIE 유형에만 사용할 수 있습니다." @@ -7295,8 +7295,8 @@ "[TAG NAME]": { "other": "[TAG NAME]" }, - "[required]": { - "other": "[필수]" + "required": { + "other": "필수" }, "accepts at most {{.Limit}} arg(s), received {{.Args}}": { "other": "대부분의 {{.Limit}} 인수를 허용하고 {{.Args}}을(를) 수신함" diff --git a/plugin/i18n/v2Resources/active.pt_BR.json b/plugin/i18n/v2Resources/active.pt_BR.json index 51c3ed20..66dc402c 100644 --- a/plugin/i18n/v2Resources/active.pt_BR.json +++ b/plugin/i18n/v2Resources/active.pt_BR.json @@ -269,8 +269,8 @@ "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n This command finds the IP address record with IP address 9.125.235.255 and displays its subnet and device information.": { "other": "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\nEXEMPLO:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n Este comando localiza o registro de endereço IP com endereço IP 9.125.235.255 e exibe suas informações de sub-rede e dispositivo." }, - "${COMMAND_NAME} sl tags set [OPTIONS]\n\nEXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { - "other": "${COMMAND_NAME} sl tags set [OPTIONS]\n\nEXEMPLO:\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" + "EXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { + "other": "EXEMPLO:\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" }, "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \nEXAMPLE:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 ": { "other": "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \nEXEMPLO:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 " @@ -320,8 +320,8 @@ "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n This command captures virtual server instance with ID of 12345678 with all disks into an image named \"mycloud\" with note \"testing\".": { "other": "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\nEXEMPLO:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n Esse comando captura a instância de servidor virtual com o ID de 12345678 com todos os discos em uma imagem chamada \"mycloud\" com a nota \"testing\"." }, - "${COMMAND_NAME} sl vs create [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { - "other": "${COMMAND_NAME} sl vs create [OPTIONS]\n\t\nEXEMPLO:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tEsse comando pede uma instância de servidor virtual com o nome do host myvsi, em que o domínio é ibm.com, possui 4 núcleos da CPU, 4.096 M de memória, está localizada no data center: dal10,\n\to sistema é UBUNTU 16 de 64 bits, com 2 discos, um de 100 G e o outro de 1.000 G e está colocada na VLAN pública com o ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tEsse comando testa se o pedido é válido com as opções acima antes que o pedido seja realmente feito.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tEsse comando exporta as opções acima para um arquivo: myvsi.txt no diretório inicial do usuário para uso posterior." + "EXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { + "other": "EXEMPLO:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tEsse comando pede uma instância de servidor virtual com o nome do host myvsi, em que o domínio é ibm.com, possui 4 núcleos da CPU, 4.096 M de memória, está localizada no data center: dal10,\n\to sistema é UBUNTU 16 de 64 bits, com 2 discos, um de 100 G e o outro de 1.000 G e está colocada na VLAN pública com o ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tEsse comando testa se o pedido é válido com as opções acima antes que o pedido seja realmente feito.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tEsse comando exporta as opções acima para um arquivo: myvsi.txt no diretório inicial do usuário para uso posterior." }, "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n Note: If you don't specify any arguments, it will attempt to update both the A\n and PTR records. If you don't want to update both records, you may use the\n -a or --ptr arguments to limit the records updated.\n \nEXAMPLE:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n This command synchronizes A record(IP V4 address) of virtual server instance with ID 12345678 to DNS server and sets ttl of this A record to 3600.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n This command synchronizes both AAAA record(IP V6 address) and PTR record of virtual server instance with ID 12345678 to DNS server.": { "other": "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n Nota: se você não especificar nenhum argumento, ele tentará atualizar os registros A\n e PTR. Se não desejar atualizar ambos os registros, será possível usar os\n argumentos -a ou --ptr para limitar os registros atualizados.\n \nEXEMPLO:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n Esse comando sincroniza o registro A (endereço IP V4) da instância de servidor virtual com o ID 12345678 para o servidor DNS e configura o ttl desse registro A como 3600.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n Esse comando sincroniza o registro AAAA (endereço IP V6) e o registro PTR da instância de servidor virtual com o ID 12345678 para o servidor DNS." @@ -1376,8 +1376,8 @@ "Comma separated list of tags, enclosed in quotes. 'tag1, tag2'": { "other": "Lista separada por vírgula de tags, colocado entre aspas. 'tag1, tag2'" }, - "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2' [required]": { - "other": "Lista separada por vírgula de tags, colocado entre aspas. 'tag1,tag2' [obrigatório]" + "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2'": { + "other": "Lista separada por vírgula de tags, colocado entre aspas. 'tag1,tag2'" }, "Company": { "other": "Empresa" @@ -3821,8 +3821,8 @@ "ID of an origin volume snapshot to use for duplication": { "other": "ID de uma captura instantânea do volume de origem para usar para duplicação" }, - "ID of the object being tagged [required]": { - "other": "ID do objeto em que está sendo colocadas as tags [obrigatório]" + "ID of the object being tagged": { + "other": "ID do objeto em que está sendo colocadas as tags" }, "IDENTIFIER": { "other": "IDENTIFIER" @@ -4097,8 +4097,8 @@ "Key Name": { "other": "Nome da Chave" }, - "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output. [required]": { - "other": "Nome da chave de um tipo de tag, por exemplo, GUEST, HARDWARE. Consulte a saída de tags slcli identificáveis. [obrigatório]" + "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output.": { + "other": "Nome da chave de um tipo de tag, por exemplo, GUEST, HARDWARE. Consulte a saída de tags slcli identificáveis." }, "Key name. It's only available in HEADER or COOKIE type": { "other": "Nome da chave. Disponível apenas no tipo HEADER ou COOKIE" @@ -7295,8 +7295,8 @@ "[TAG NAME]": { "other": "[TAG NAME]" }, - "[required]": { - "other": "[necessário]" + "required": { + "other": "necessário" }, "accepts at most {{.Limit}} arg(s), received {{.Args}}": { "other": "aceita no máximo {{.Limit}} argumentos, recebido {{.Args}}" diff --git a/plugin/i18n/v2Resources/active.zh_Hans.json b/plugin/i18n/v2Resources/active.zh_Hans.json index 04d100e1..5e9c4a0e 100644 --- a/plugin/i18n/v2Resources/active.zh_Hans.json +++ b/plugin/i18n/v2Resources/active.zh_Hans.json @@ -269,8 +269,8 @@ "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n This command finds the IP address record with IP address 9.125.235.255 and displays its subnet and device information.": { "other": "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\n示例:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n 此命令查找 IP 地址为 9.125.235.255 的 IP 地址记录,并显示其子网和设备信息。" }, - "${COMMAND_NAME} sl tags set [OPTIONS]\n\nEXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { - "other": "${COMMAND_NAME} sl tags set [OPTIONS]\n\n示例:\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" + "EXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { + "other": "示例:\n${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n" }, "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \nEXAMPLE:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 ": { "other": "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \n示例:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567" @@ -320,8 +320,8 @@ "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n This command captures virtual server instance with ID of 12345678 with all disks into an image named \"mycloud\" with note \"testing\".": { "other": "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\n示例:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n 此命令将标识为 12345678 的虚拟服务器实例及所有磁盘捕获到名为“mycloud”的映像中,注释为“testing”。" }, - "${COMMAND_NAME} sl vs create [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { - "other": "${COMMAND_NAME} sl vs create [OPTIONS]\n\t\n示例:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\t此命令订购虚拟服务器实例,其中主机名为 myvsi,域为 ibm.com,4 个 CPU 核心,4096M 内存,位于数据中心 dal10,\n\t操作系统为 UBUNTU 16 64 位,2 个磁盘,一个为 100G,另一个为 1000G,位于标识为 413 的公用 VLAN 上。\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\t此命令用于在实际下达使用上述选项的订单之前,测试该订单是否有效。\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\t此命令将上述选项导出到用户主目录下的文件 myvsi.txt 中,以供以后使用。" + "EXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { + "other": "示例:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\t此命令订购虚拟服务器实例,其中主机名为 myvsi,域为 ibm.com,4 个 CPU 核心,4096M 内存,位于数据中心 dal10,\n\t操作系统为 UBUNTU 16 64 位,2 个磁盘,一个为 100G,另一个为 1000G,位于标识为 413 的公用 VLAN 上。\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\t此命令用于在实际下达使用上述选项的订单之前,测试该订单是否有效。\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\t此命令将上述选项导出到用户主目录下的文件 myvsi.txt 中,以供以后使用。" }, "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n Note: If you don't specify any arguments, it will attempt to update both the A\n and PTR records. If you don't want to update both records, you may use the\n -a or --ptr arguments to limit the records updated.\n \nEXAMPLE:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n This command synchronizes A record(IP V4 address) of virtual server instance with ID 12345678 to DNS server and sets ttl of this A record to 3600.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n This command synchronizes both AAAA record(IP V6 address) and PTR record of virtual server instance with ID 12345678 to DNS server.": { "other": "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n 注:如果未指定任何自变量,那么将尝试同时更新 A\n 和 PTR 记录。如果不想同时更新这两个记录,可使用\n -a 或 --ptr 自变量来限制更新的记录。\n \n示例:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n 此命令将标识为 12345678 的虚拟服务器实例的 A 记录(IP V4 地址)与 DNS 服务器同步,并将此 A 记录的 ttl 设置为 3600。\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n 此命令将标识为 12345678 的虚拟服务器实例的 AAAA 记录(IP V6 地址)和 PTR 记录同时与 DNS 服务器同步。" @@ -1376,8 +1376,8 @@ "Comma separated list of tags, enclosed in quotes. 'tag1, tag2'": { "other": "以逗号分隔的标记列表,括在引号中。 'tag1, tag2'" }, - "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2' [required]": { - "other": "以逗号分隔的标记列表,括在引号中。 'tag1,tag2' [必需]" + "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2'": { + "other": "以逗号分隔的标记列表,括在引号中。 'tag1,tag2'" }, "Company": { "other": "公司" @@ -3821,8 +3821,8 @@ "ID of an origin volume snapshot to use for duplication": { "other": "用于复制的源卷快照的标识" }, - "ID of the object being tagged [required]": { - "other": "正在标记的对象的标识 [必需]" + "ID of the object being tagged": { + "other": "正在标记的对象的标识" }, "IDENTIFIER": { "other": "IDENTIFIER" @@ -4097,8 +4097,8 @@ "Key Name": { "other": "键名" }, - "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output. [required]": { - "other": "标记类型的键名称,例如 GUEST、HARDWARE。 请参阅 slcli 标记可标记输出。[必需]" + "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output.": { + "other": "标记类型的键名称,例如 GUEST、HARDWARE。 请参阅 slcli 标记可标记输出。" }, "Key name. It's only available in HEADER or COOKIE type": { "other": "密钥名称。仅在 HEADER 或 COOKIE 类型中可用" @@ -7295,8 +7295,8 @@ "[TAG NAME]": { "other": "[标记名称]" }, - "[required]": { - "other": "[必需]" + "required": { + "other": "必需" }, "accepts at most {{.Limit}} arg(s), received {{.Args}}": { "other": "最多接受 {{.Limit}} 个参数,已收到 {{.Args}} 个" diff --git a/plugin/i18n/v2Resources/active.zh_Hant.json b/plugin/i18n/v2Resources/active.zh_Hant.json index 205e3840..dcb1a79d 100644 --- a/plugin/i18n/v2Resources/active.zh_Hant.json +++ b/plugin/i18n/v2Resources/active.zh_Hant.json @@ -269,8 +269,8 @@ "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n This command finds the IP address record with IP address 9.125.235.255 and displays its subnet and device information.": { "other": "${COMMAND_NAME} sl subnet lookup IP_ADDRESS [OPTIONS]\n\t\n範例:\n ${COMMAND_NAME} sl subnet lookup 9.125.235.255\n 這個指令會尋找 IP 位址為 9.125.235.255 的 IP 位址記錄,並顯示其子網路和裝置資訊。" }, - "${COMMAND_NAME} sl tags set [OPTIONS]\n\nEXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { - "other": "${COMMAND_NAME} sl tags set [OPTIONS] \n \n 範例:\n ${COMMAND_NAME} sl tags set -- tags 'tag1,tag2' -- key-name HARDWARE -- resource-id 123456\n" + "EXAMPLE:\n\t${COMMAND_NAME} sl tags set --tags 'tag1,tag2' --key-name HARDWARE --resource-id 123456\n": { + "other": "範例:\n ${COMMAND_NAME} sl tags set -- tags 'tag1,tag2' -- key-name HARDWARE -- resource-id 123456\n" }, "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \nEXAMPLE:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567 ": { "other": "${COMMAND_NAME} sl ticket attach TICKETID [OPTIONS]\n \n範例:\n ${COMMAND_NAME} sl ticket attach 7676767 --hardware 8675654 \n ${COMMAND_NAME} sl ticket attach 7676767 --virtual 1234567" @@ -320,8 +320,8 @@ "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n This command captures virtual server instance with ID of 12345678 with all disks into an image named \"mycloud\" with note \"testing\".": { "other": "${COMMAND_NAME} sl vs capture IDENTIFIER [OPTIONS]\n\t\n範例:\n ${COMMAND_NAME} sl vs capture 12345678 -n mycloud --all --note testing\n 這個指令會將虛擬伺服器實例(其 ID 為 12345678)及其所有磁碟擷取至名為 \"mycloud\" 且附註 \"testing\" 的映像檔。" }, - "${COMMAND_NAME} sl vs create [OPTIONS]\n\t\nEXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { - "other": "${COMMAND_NAME} sl vs create [OPTIONS]\n\t\n範例:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\t這個指令會訂購虛擬伺服器實例,其主機名稱為 myvsi、網域為 ibm.com、有 4 個 CPU 核心、4096M 的記憶體、位於資料中心 dal10、\n\t作業系統為 UBUNTU 16 64 位元、有 2 個磁碟(一個 100G,另一個 1000G)、放在公用 VLAN(其 ID 為 413)。\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\t這個指令會先以上述選項來測試訂單是否有效,再實際下單。\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\t這個指令會將上述選項匯出至使用者起始目錄下的 myvsi.txt 檔案,以供稍後使用。" + "EXAMPLE:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\tThis command orders a virtual server instance with hostname is myvsi, domain is ibm.com, 4 cpu cores, 4096M memory, located at datacenter: dal10,\n\toperation system is UBUNTU 16 64 bits, 2 disks, one is 100G, the other is 1000G, and placed at public vlan with ID 413.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\tThis command tests whether the order is valid with above options before the order is actually placed.\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\tThis command exports above options to a file: myvsi.txt under user home directory for later use.": { + "other": "範例:\n ${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413\n\t這個指令會訂購虛擬伺服器實例,其主機名稱為 myvsi、網域為 ibm.com、有 4 個 CPU 核心、4096M 的記憶體、位於資料中心 dal10、\n\t作業系統為 UBUNTU 16 64 位元、有 2 個磁碟(一個 100G,另一個 1000G)、放在公用 VLAN(其 ID 為 413)。\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --test\n\t這個指令會先以上述選項來測試訂單是否有效,再實際下單。\n\t${COMMAND_NAME} sl vs create -H myvsi -D ibm.com -c 4 -m 4096 -d dal10 -o UBUNTU_16_64 --disk 100 --disk 1000 --vlan-public 413 --export ~/myvsi.txt\n\t這個指令會將上述選項匯出至使用者起始目錄下的 myvsi.txt 檔案,以供稍後使用。" }, "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n Note: If you don't specify any arguments, it will attempt to update both the A\n and PTR records. If you don't want to update both records, you may use the\n -a or --ptr arguments to limit the records updated.\n \nEXAMPLE:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n This command synchronizes A record(IP V4 address) of virtual server instance with ID 12345678 to DNS server and sets ttl of this A record to 3600.\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n This command synchronizes both AAAA record(IP V6 address) and PTR record of virtual server instance with ID 12345678 to DNS server.": { "other": "${COMMAND_NAME} sl vs dns-sync IDENTIFIER [OPTIONS]\n 附註:如果您未指定任何引數,則會嘗試更新 A\n 和 PTR 記錄。如果不想要兩個記錄都更新,您可以使用\n-a 或 --ptr 引數來限制更新的記錄。\n \n範例:\n ${COMMAND_NAME} sl vs dns-sync 12345678 --a-record --ttl 3600\n 這個指令會將虛擬伺服器實例(其 ID 為 12345678)的 A 記錄(IP V4 位址)同步至 DNS 伺服器,並將這個 A 記錄的 ttl 設為 3600。\n ${COMMAND_NAME} sl vs dns-sync 12345678 --aaaa-record --ptr\n 這個指令會將虛擬伺服器實例(其 ID 為 12345678)的 AAAA 記錄(IP V6 位址)和 PTR 記錄都同步至 DNS 伺服器。" @@ -1376,8 +1376,8 @@ "Comma separated list of tags, enclosed in quotes. 'tag1, tag2'": { "other": "以逗點區隔的標籤清單,以引號括住。 'tag1, tag2'" }, - "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2' [required]": { - "other": "以逗點區隔的標籤清單,以引號括住。 'tag1,tag2' [必要]" + "Comma seperated list of tags, enclosed in quotes. 'tag1,tag2'": { + "other": "以逗點區隔的標籤清單,以引號括住。 'tag1,tag2'" }, "Company": { "other": "公司" @@ -3821,8 +3821,8 @@ "ID of an origin volume snapshot to use for duplication": { "other": "要用於複製的原始磁區 Snapshot 的 ID" }, - "ID of the object being tagged [required]": { - "other": "所標記物件的 ID [必要]" + "ID of the object being tagged": { + "other": "所標記物件的 ID" }, "IDENTIFIER": { "other": "IDENTIFIER" @@ -4097,8 +4097,8 @@ "Key Name": { "other": "索引鍵名稱" }, - "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output. [required]": { - "other": "標籤類型的金鑰名稱,例如 GUEST、HARDWARE。 請參閱 slcli tags taggable 輸出。[必要]" + "Key name of a tag type e.g. GUEST, HARDWARE. See slcli tags taggable output.": { + "other": "標籤類型的金鑰名稱,例如 GUEST、HARDWARE。 請參閱 slcli tags taggable 輸出。" }, "Key name. It's only available in HEADER or COOKIE type": { "other": "金鑰名稱。只提供於 HEADER 或 COOKIE 類型" @@ -7295,8 +7295,8 @@ "[TAG NAME]": { "other": "[標籤名稱]" }, - "[required]": { - "other": "[必要]" + "required": { + "other": "必要" }, "accepts at most {{.Limit}} arg(s), received {{.Args}}": { "other": "最多接受 {{.Limit}} 個引數,已收到 {{.Args}} 個" diff --git a/plugin/managers/account.go b/plugin/managers/account.go index 388cfb34..03262285 100644 --- a/plugin/managers/account.go +++ b/plugin/managers/account.go @@ -52,6 +52,10 @@ func NewAccountManager(session *session.Session) *accountManager { // the keys of the inner map are: vlan_count, public_ip_count, subnet_count, hardware_count, virtual_guest_count // the value of the innter map are the count of those resources func (a accountManager) SummaryByDatacenter() (map[string]map[string]int, error) { + DEFAULT_VLAN_MASK := `mask[ +hardwareCount,subnetCount,totalPrimaryIpAddressCount,virtualGuestCount, +primaryRouter[id, fullyQualifiedDomainName, datacenter[name]], +]` datacenters := make(map[string](map[string]int)) vlans, err := a.AccountService.Mask(DEFAULT_VLAN_MASK).GetNetworkVlans() if err != nil { diff --git a/plugin/managers/network.go b/plugin/managers/network.go index 3c4c3a46..5ef026d5 100644 --- a/plugin/managers/network.go +++ b/plugin/managers/network.go @@ -18,7 +18,6 @@ const ( DEFAULT_IP_MASK = "hardware,virtualGuest,subnet[id,networkIdentifier,cidr,netmask,gateway,subnetType]" DEFAULT_SUBNET_MASK = "id,datacenter.name,hardware.id,ipAddresses.id,networkIdentifier,networkVlan[id,networkSpace],subnetType,virtualGuests.id" DEFAULT_SUBNET_DETAIL_MASK = "id,broadcastAddress,cidr,datacenter.name,gateway,hardware[id,hostname,domain,primaryIpAddress,primaryBackendIpAddress],ipAddresses.id,networkIdentifier,networkVlan[id,networkSpace],subnetType,virtualGuests[id,hostname,domain,primaryIpAddress,primaryBackendIpAddress]" - DEFAULT_VLAN_MASK = "firewallInterfaces,hardwareCount,primaryRouter[id, fullyQualifiedDomainName, datacenter],subnetCount,billingItem,totalPrimaryIpAddressCount,virtualGuestCount,networkSpace,networkVlanFirewall[id,fullyQualifiedDomainName,primaryIpAddress],attachedNetworkGateway[id,name,networkFirewall],tagReferences[tag[name]]" DEFAULT_VLAN_DETAIL_MASK = "id,vlanNumber,primaryRouter[datacenterName,fullyQualifiedDomainName],firewallInterfaces," + "subnets[id,networkIdentifier,netmask,gateway,subnetType,usableIpAddressCount]," + "virtualGuests[hostname,domain,primaryIpAddress,primaryBackendIpAddress]," + @@ -453,6 +452,17 @@ destinationIpAddress[ipAddress,virtualGuest.fullyQualifiedDomainName,hardware.fu // name: name of vlan to be filtered // orderId: ID of order to be filtered func (n networkManager) ListVlans(datacenter string, vlanNum int, name string, orderId int, mask string) ([]datatypes.Network_Vlan, error) { + DEFAULT_VLAN_MASK := `mask[ +id,vlanNumber,fullyQualifiedName,name,networkSpace, +firewallInterfaces, +hardwareCount,subnetCount,totalPrimaryIpAddressCount,virtualGuestCount, +primaryRouter[id, fullyQualifiedDomainName, datacenter], +billingItem, +networkVlanFirewall[id,fullyQualifiedDomainName,primaryIpAddress], +attachedNetworkGateway[id,name,networkFirewall], +tagReferences[tag[name]] +]` + filters := filter.New() filters = append(filters, filter.Path("networkVlans.id").OrderBy("ASC")) if datacenter != "" { diff --git a/plugin/metadata/args.go b/plugin/metadata/args.go index b84054bd..54a1f565 100644 --- a/plugin/metadata/args.go +++ b/plugin/metadata/args.go @@ -16,9 +16,12 @@ func NoArgs(cmd *cobra.Command, args []string) error { if len(args) > 0 { subs := map[string]interface{}{ "Arg": args[0], - "Command": cmd.CommandPath(), + "Path": cmd.CommandPath(), } - return fmt.Errorf(T("unknown command {{.Arg}} for {{.Command}}", subs)) + return fmt.Errorf("%s%s", + T("Incorrect Usage: "), + T("invalid argument {{.Arg}} for {{.Path}}", subs), + ) } return nil } diff --git a/plugin/plugin.go b/plugin/plugin.go index 3ce0dd3d..799e4d36 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -6,6 +6,8 @@ import ( "reflect" "regexp" "strings" + "bytes" + "text/template" trace "github.com/IBM-Cloud/ibm-cloud-cli-sdk/bluemix/trace" @@ -55,10 +57,71 @@ import ( "github.ibm.com/SoftLayer/softlayer-cli/plugin/commands/vlan" ) -var USEAGE_TEMPLATE = `${COMMAND_NAME} {{if .HasParent}}{{.Parent.CommandPath}} {{.Use}}{{else}}{{.Use}}{{end}}` + - `{{if .HasLocalFlags}} [` + T("OPTIONS") + `] {{end}} +var USEAGE_TEMPLATE = `${COMMAND_NAME} {{if .HasParent}}{{.Parent.CommandPath}} {{.Use}}{{else}}{{.Use}}{{end}}` + +`{{if .HasLocalFlags}} [` + T("OPTIONS") + `] {{RequiredFlags .LocalFlags}} {{end}} + {{.Long}}` +// https://github.ibm.com/ibmcloud-cli/bluemix-cli/blob/master/bluemix/cli/help.go#L68 +// Copied/pasted because I don't want to import the whole bluemix/cli lib just for this +var BX_TEMPLATE = `{{"NAME:" | T | HeaderColor}} + {{.Name}}{{with .Aliases}}{{range .}}, {{.}}{{end}}{{end}} - {{.Short}} + +{{"USAGE:" | T | HeaderColor}} + {{UsageCommandString . }}{{if .HasAvailableSubCommands}}{{$cmds := .Commands}}{{if eq (len .Groups) 0}} +{{"Available Commands:" | HeaderColor}}{{range $cmds}}{{if (or .IsAvailableCommand (eq .Name "help"))}} + {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{else}}{{range $group := .Groups}} +{{.Title}}{{range $cmds}}{{if (and (eq .GroupID $group.ID) (or .IsAvailableCommand (eq .Name "help")))}} + {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if not .AllChildCommandsHaveGroup}} +Additional Commands:{{range $cmds}}{{if (and (eq .GroupID "") (or .IsAvailableCommand (eq .Name "help")))}} + {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}} +{{"OPTIONS:" | T | HeaderColor}} +{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{if .HasAvailableInheritedFlags}} +{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{end}} +` + +// Adds HeaderColor to string in a template +func HeaderColor(text string) string { + return terminal.HeaderColor(text) +} + +// Cobra Default Template is: https://github.com/spf13/cobra/blob/v1.8.1/command.go#L546 +// Used to mark flags that are required in the Usage String +func RequiredFlags(flags *pflag.FlagSet) string { + requiredFlags := "" + flags.VisitAll(func(pflag *pflag.Flag) { + flagName := pflag.Name + if pflag.Shorthand != "" { + flagName = pflag.Shorthand + "," + pflag.Name + } + + // Check if this flag is Required. + // Copied logic from https://github.com/spf13/cobra/blob/v1.8.1/command.go#L1149 + // There is also an annotation for mutually exclusive we might want to look into. + requiredAnnotation, found := pflag.Annotations[cobra.BashCompOneRequiredFlag] + if found && requiredAnnotation[0] == "true" { + requiredFlags = fmt.Sprintf("%s--%s <%s> ", requiredFlags, flagName, strings.ToUpper(pflag.Value.Type())) + } + }) + return requiredFlags +} + +// Since we overwrite the cobra Usage template, we need to build it manually. +func UsageCommandString(cmd *cobra.Command) string { + var buf bytes.Buffer + var templateFuncs = template.FuncMap{ + "RequiredFlags": RequiredFlags, + } + usage := template.New("usage") + usage.Funcs(templateFuncs) + template.Must(usage.Parse(USEAGE_TEMPLATE)) + err := usage.Execute(&buf, cmd) + if err != nil { + return err.Error() + } + return buf.String() +} + func (sl *SoftlayerPlugin) GetMetadata() plugin.PluginMetadata { return plugin.PluginMetadata{ Name: metadata.NS_SL_NAME, @@ -101,6 +164,7 @@ func (sl *SoftlayerPlugin) Run(context plugin.PluginContext, args []string) { "unknown flag", "unknown command", "unknown shorthand flag", + "required flag(s)", T("Incorrect Usage: "), T("Invalid input for")} for _, trigger := range helpTextTriggers { @@ -116,25 +180,41 @@ func (sl *SoftlayerPlugin) Run(context plugin.PluginContext, args []string) { } // This function helps to translate errors coming from Cobra, the common ones in any case. +// If you update this, update the version in testhelpers/fake_command_runner.go as well. +// Or make this a util if we update it a lot func TranslateError(errorMessage string) string { if strings.HasPrefix(errorMessage, "unknown command") { - r, _ := regexp.Compile(`unknown command "(\w+)"`) + // If the 'command' is a number it won't have "" around it, like: + r, _ := regexp.Compile(`unknown command "?(\w+)"? `) matches := r.FindStringSubmatch(errorMessage) - fmt.Println(matches) - subs := map[string]interface{}{"CMD": matches[1]} + subs := map[string]interface{}{"CMD": ""} + if len(matches) >= 2 { + subs["CMD"] = matches[1] + } else { + subs["CMD"], _ = strings.CutPrefix(errorMessage, "unknown command ") + } + return T("Unknown Command '{{.CMD}}'",subs) } else if strings.HasPrefix(errorMessage, "unknown flag") { r, _ := regexp.Compile(`unknown flag: (\S+)`) matches := r.FindStringSubmatch(errorMessage) - fmt.Println(matches) subs := map[string]interface{}{"CMD": matches[1]} return T("Unknown Flag '{{.CMD}}'", subs) } else if strings.HasPrefix(errorMessage, "unknown shorthand flag") { r, _ := regexp.Compile(`unknown shorthand flag: '(\S+)'`) matches := r.FindStringSubmatch(errorMessage) - fmt.Println(matches) subs := map[string]interface{}{"CMD": matches[1]} return T("Unknown Flag '{{.CMD}}'", subs) + } else if strings.HasPrefix(errorMessage, "required flag(s)") { + r, _ := regexp.Compile(`("[0-9A-Za-z\-]+")`) + matches := r.FindAllStringSubmatch(errorMessage, -1) + missingFlags := make([]string, len(matches)) + for i, flag := range matches { + this_flag := strings.ReplaceAll(flag[0], `"`, "") + subs := map[string]interface{}{"CMD": fmt.Sprintf("--%s", this_flag)} + missingFlags[i] = T("Incorrect Usage: '{{.CMD}}' is required", subs) + } + return strings.Join(missingFlags, "\n") } else { return T(errorMessage) } @@ -191,6 +271,17 @@ func cobraFlagToPlugin(flagSet *pflag.FlagSet) []plugin.Flag { if reflect.TypeOf(pflag.Value).String() == "*pflag.boolValue" { hasValue = false } + // Check if this flag is Required. + // Copied logic from https://github.com/spf13/cobra/blob/v1.8.1/command.go#L1149 + // There is also an annotation for mutually exclusive we might want to look into. + requiredAnnotation, found := pflag.Annotations[cobra.BashCompOneRequiredFlag] + if found && requiredAnnotation[0] == "true" { + // Some flags have [required] hard coded in the description, so skip these + if !strings.Contains(flagDesc, T("required")) { + flagDesc = fmt.Sprintf("%s [%s]", flagDesc, T("required")) + } + + } thisFlag := plugin.Flag{ Name: flagName, Description: flagDesc, @@ -227,7 +318,7 @@ func defaultIsZeroValue(f *pflag.Flag) bool { func cobraToCLIMeta(topCommand *cobra.Command, namespace string) []plugin.Command { var pluginCommands []plugin.Command // Custom Usage to ibmcloud CLI prints out a nice messages for us - topCommand.SetUsageTemplate(USEAGE_TEMPLATE) + for _, cliCmd := range topCommand.Commands() { if len(cliCmd.Commands()) > 0 { pluginCommands = append(pluginCommands, cobraToCLIMeta(cliCmd, namespace+" "+cliCmd.Use)...) @@ -236,9 +327,8 @@ func cobraToCLIMeta(topCommand *cobra.Command, namespace string) []plugin.Comman Namespace: namespace, Name: cliCmd.Name(), Description: cliCmd.Short, - Usage: cliCmd.UsageString(), - // try using the ibm-cloud/ibm-cloud-cli-sdk/plugin/plugin.ConvertCObraFlagsToPluginFlags - Flags: cobraFlagToPlugin(cliCmd.Flags()), + Usage: UsageCommandString(cliCmd), + Flags: cobraFlagToPlugin(cliCmd.Flags()), } pluginCommands = append(pluginCommands, thisCmd) } @@ -259,7 +349,12 @@ func GetTopCobraCommand(ui terminal.UI, session *session.Session) *cobra.Command SilenceUsage: true, // Surpresses help text on errors SilenceErrors: true, } - + // This is to mock the `ibmcloud` usage string. Not perfect, but its close to what you can expect + cobra.AddTemplateFunc("UsageCommandString", UsageCommandString) + cobra.AddTemplateFunc("HeaderColor", HeaderColor) + cobra.AddTemplateFunc("T", T) + cobraCmd.SetUsageTemplate(BX_TEMPLATE) + cobraCmd.SetHelpTemplate(`{{.UsageString}}`) versionCommand := &cobra.Command{ Use: "version", Short: T("Print the version of the sl plugin"), diff --git a/plugin/utils/utils.go b/plugin/utils/utils.go index 9c2411d0..b42119d3 100644 --- a/plugin/utils/utils.go +++ b/plugin/utils/utils.go @@ -251,6 +251,17 @@ func FormatSLTimePointer(value *datatypes.Time) string { return value.UTC().Format(time.RFC3339) } +// Date formats are in '2006-01-02 15:04:05' format +func FormatSLTimePointerCustom(value *datatypes.Time, time_format string) string { + if value == nil { + return EMPTY_VALUE + } + if time_format == "" { + time_format = time.RFC3339 + } + return value.UTC().Format(time_format) +} + func Bool2Int(value bool) int { if value { return 1