Skip to content
Snippets Groups Projects
Unverified Commit 9179a86f authored by renovate[bot]'s avatar renovate[bot] Committed by GitHub
Browse files

Update github.com/gophercloud/utils digest to de873b9

parent fa691ab8
No related branches found
No related tags found
No related merge requests found
Showing
with 1143 additions and 761 deletions
...@@ -4,8 +4,8 @@ go 1.15 ...@@ -4,8 +4,8 @@ go 1.15
require ( require (
github.com/google/uuid v1.1.2 github.com/google/uuid v1.1.2
github.com/gophercloud/gophercloud v0.15.1-0.20210205220151-18b16b34db5c github.com/gophercloud/gophercloud v1.3.0
github.com/gophercloud/utils v0.0.0-20210209042946-13abf2251886 github.com/gophercloud/utils v0.0.0-20230523080330-de873b9cf00d
github.com/kayrus/putty v1.0.4 github.com/kayrus/putty v1.0.4
github.com/spf13/cobra v1.0.0 github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.7.1 github.com/spf13/viper v1.7.1
......
...@@ -74,8 +74,12 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m ...@@ -74,8 +74,12 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m
github.com/gophercloud/gophercloud v0.15.1-0.20210202035223-633d73521055/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4= github.com/gophercloud/gophercloud v0.15.1-0.20210202035223-633d73521055/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4=
github.com/gophercloud/gophercloud v0.15.1-0.20210205220151-18b16b34db5c h1:b2RbksWlL+LFiivwz2egXAfmwQlWDmpueyF5GEsLVcc= github.com/gophercloud/gophercloud v0.15.1-0.20210205220151-18b16b34db5c h1:b2RbksWlL+LFiivwz2egXAfmwQlWDmpueyF5GEsLVcc=
github.com/gophercloud/gophercloud v0.15.1-0.20210205220151-18b16b34db5c/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4= github.com/gophercloud/gophercloud v0.15.1-0.20210205220151-18b16b34db5c/go.mod h1:wRtmUelyIIv3CSSDI47aUwbs075O6i+LY+pXsKCBsb4=
github.com/gophercloud/gophercloud v1.3.0 h1:RUKyCMiZoQR3VlVR5E3K7PK1AC3/qppsWYo6dtBiqs8=
github.com/gophercloud/gophercloud v1.3.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM=
github.com/gophercloud/utils v0.0.0-20210209042946-13abf2251886 h1:6VH2sy8abNypW0rHltOkkiiSrNB5ElPlWIIRc57uUyk= github.com/gophercloud/utils v0.0.0-20210209042946-13abf2251886 h1:6VH2sy8abNypW0rHltOkkiiSrNB5ElPlWIIRc57uUyk=
github.com/gophercloud/utils v0.0.0-20210209042946-13abf2251886/go.mod h1:wx8HMD8oQD0Ryhz6+6ykq75PJ79iPyEqYHfwZ4l7OsA= github.com/gophercloud/utils v0.0.0-20210209042946-13abf2251886/go.mod h1:wx8HMD8oQD0Ryhz6+6ykq75PJ79iPyEqYHfwZ4l7OsA=
github.com/gophercloud/utils v0.0.0-20230523080330-de873b9cf00d h1:6Gvua77nKyAiZQpu0N3AsamGu1L6Mlnhp3tAtDcqwvc=
github.com/gophercloud/utils v0.0.0-20230523080330-de873b9cf00d/go.mod h1:VSalo4adEk+3sNkmVJLnhHoOyOYYS8sTWLG4mv5BKto=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= 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/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
...@@ -96,6 +100,8 @@ github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdv ...@@ -96,6 +100,8 @@ github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdv
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
...@@ -214,6 +220,7 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U ...@@ -214,6 +220,7 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU=
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
...@@ -251,6 +258,7 @@ golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR ...@@ -251,6 +258,7 @@ golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
...@@ -277,11 +285,14 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w ...@@ -277,11 +285,14 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
...@@ -291,6 +302,7 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= ...@@ -291,6 +302,7 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
......
**/*.swp **/*.swp
.idea .idea
.vscode .vscode
testing_*.coverprofile
- job:
name: gophercloud-unittest
parent: golang-test
description: |
Run gophercloud unit test
run: .zuul/playbooks/gophercloud-unittest/run.yaml
nodeset: ubuntu-xenial-ut
- job:
name: gophercloud-acceptance-test
parent: golang-test
description: |
Run gophercloud acceptance test on master branch
run: .zuul/playbooks/gophercloud-acceptance-test/run.yaml
timeout: 18000 # 5 hours
nodeset: ubuntu-bionic
- job:
name: gophercloud-acceptance-test-ironic
parent: golang-test
description: |
Run gophercloud ironic acceptance test on master branch
run: .zuul/playbooks/gophercloud-acceptance-test-ironic/run.yaml
nodeset: ubuntu-bionic
- job:
name: gophercloud-acceptance-test-ussuri
parent: gophercloud-acceptance-test
description: |
Run gophercloud acceptance test on ussuri branch
vars:
global_env:
OS_BRANCH: stable/ussuri
- job:
name: gophercloud-acceptance-test-train
parent: gophercloud-acceptance-test
description: |
Run gophercloud acceptance test on train branch
vars:
global_env:
OS_BRANCH: stable/train
- job:
name: gophercloud-acceptance-test-stein
parent: gophercloud-acceptance-test
description: |
Run gophercloud acceptance test on stein branch
vars:
global_env:
OS_BRANCH: stable/stein
- job:
name: gophercloud-acceptance-test-rocky
parent: gophercloud-acceptance-test
description: |
Run gophercloud acceptance test on rocky branch
vars:
global_env:
OS_BRANCH: stable/rocky
- job:
name: gophercloud-acceptance-test-queens
parent: gophercloud-acceptance-test
description: |
Run gophercloud acceptance test on queens branch
nodeset: ubuntu-xenial
vars:
global_env:
OS_BRANCH: stable/queens
# NOTE: A Pike-based devstack environment is currently
# not building correctly. This might be a temporary issue.
- job:
name: gophercloud-acceptance-test-pike
parent: gophercloud-acceptance-test
description: |
Run gophercloud acceptance test on pike branch
nodeset: ubuntu-xenial
vars:
global_env:
OS_BRANCH: stable/pike
- job:
name: gophercloud-acceptance-test-ocata
parent: gophercloud-acceptance-test
description: |
Run gophercloud acceptance test on ocata branch
nodeset: ubuntu-xenial
vars:
global_env:
OS_BRANCH: stable/ocata
# NOTE: A Newton-based devstack environment is currently
# not building correctly. This might be a temporary issue.
- job:
name: gophercloud-acceptance-test-newton
parent: gophercloud-acceptance-test
description: |
Run gophercloud acceptance test on newton branch
nodeset: ubuntu-xenial
vars:
global_env:
OS_BRANCH: stable/newton
- project:
name: gophercloud/gophercloud
check:
jobs:
- gophercloud-unittest
- gophercloud-acceptance-test
- gophercloud-acceptance-test-ironic
recheck-newton:
jobs:
- gophercloud-acceptance-test-newton
recheck-ocata:
jobs:
- gophercloud-acceptance-test-ocata
recheck-pike:
jobs:
- gophercloud-acceptance-test-pike
recheck-queens:
jobs:
- gophercloud-acceptance-test-queens
recheck-rocky:
jobs:
- gophercloud-acceptance-test-rocky
recheck-stein:
jobs:
- gophercloud-acceptance-test-stein
recheck-train:
jobs:
- gophercloud-acceptance-test-train
recheck-ussuri:
jobs:
- gophercloud-acceptance-test-ussuri
This diff is collapsed.
Copyright 2012-2013 Rackspace, Inc. Copyright 2012-2013 Rackspace, Inc.
Copyright Gophercloud authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the this file except in compliance with the License. You may obtain a copy of the
......
...@@ -11,72 +11,96 @@ Gophercloud is an OpenStack Go SDK. ...@@ -11,72 +11,96 @@ Gophercloud is an OpenStack Go SDK.
## How to install ## How to install
Before installing, you need to ensure that your [GOPATH environment variable](https://golang.org/doc/code.html#GOPATH) Reference a Gophercloud package in your code:
is pointing to an appropriate directory where you want to install Gophercloud:
```bash ```go
mkdir $HOME/go import "github.com/gophercloud/gophercloud"
export GOPATH=$HOME/go
``` ```
To protect yourself against changes in your dependencies, we highly recommend choosing a Then update your `go.mod`:
[dependency management solution](https://github.com/golang/go/wiki/PackageManagementTools) for
your projects, such as [godep](https://github.com/tools/godep). Once this is set up, you can install
Gophercloud as a dependency like so:
```bash
go get github.com/gophercloud/gophercloud
# Edit your code to import relevant packages from "github.com/gophercloud/gophercloud"
godep save ./... ```shell
go mod tidy
``` ```
This will install all the source files you need into a `Godeps/_workspace` directory, which is
referenceable from your own source files when you use the `godep go` command.
## Getting started ## Getting started
### Credentials ### Credentials
Because you'll be hitting an API, you will need to retrieve your OpenStack Because you'll be hitting an API, you will need to retrieve your OpenStack
credentials and either store them as environment variables or in your local Go credentials and either store them in a `clouds.yaml` file, as environment
files. The first method is recommended because it decouples credential variables, or in your local Go files. The first method is recommended because
information from source code, allowing you to push the latter to your version it decouples credential information from source code, allowing you to push the
control system without any security risk. latter to your version control system without any security risk.
You will need to retrieve the following: You will need to retrieve the following:
* username * A valid Keystone identity URL
* password * Credentials. These can be a username/password combo, a set of Application
* a valid Keystone identity URL Credentials, a pre-generated token, or any other supported authentication
mechanism.
For users that have the OpenStack dashboard installed, there's a shortcut. If For users that have the OpenStack dashboard installed, there's a shortcut. If
you visit the `project/access_and_security` path in Horizon and click on the you visit the `project/api_access` path in Horizon and click on the
"Download OpenStack RC File" button at the top right hand corner, you will "Download OpenStack RC File" button at the top right hand corner, you can
download a bash file that exports all of your access details to environment download either a `clouds.yaml` file or an `openrc` bash file that exports all
variables. To execute the file, run `source admin-openrc.sh` and you will be of your access details to environment variables. To use the `clouds.yaml` file,
prompted for your password. place it at `~/.config/openstack/clouds.yaml`. To use the `openrc` file, run
`source openrc` and you will be prompted for your password.
### Authentication ### Authentication
> NOTE: It is now recommended to use the `clientconfig` package found at
> https://github.com/gophercloud/utils/tree/master/openstack/clientconfig
> for all authentication purposes.
>
> The below documentation is still relevant. clientconfig simply implements
> the below and presents it in an easier and more flexible way.
Once you have access to your credentials, you can begin plugging them into Once you have access to your credentials, you can begin plugging them into
Gophercloud. The next step is authentication, and this is handled by a base Gophercloud. The next step is authentication, which is handled by a base
"Provider" struct. To get one, you can either pass in your credentials "Provider" struct. There are number of ways to construct such a struct.
explicitly, or tell Gophercloud to use environment variables:
**With `gophercloud/utils`**
The [github.com/gophercloud/utils](https://github.com/gophercloud/utils)
library provides the `clientconfig` package to simplify authentication. It
provides additional functionality, such as the ability to read `clouds.yaml`
files. To generate a "Provider" struct using the `clientconfig` package:
```go ```go
import ( import (
"github.com/gophercloud/gophercloud" "github.com/gophercloud/utils/openstack/clientconfig"
"github.com/gophercloud/gophercloud/openstack" )
"github.com/gophercloud/gophercloud/openstack/utils"
// You can also skip configuring this and instead set 'OS_CLOUD' in your
// environment
opts := new(clientconfig.ClientOpts)
opts.Cloud = "devstack-admin"
provider, err := clientconfig.AuthenticatedClient(opts)
```
A provider client is a top-level client that all of your OpenStack service
clients derive from. The provider contains all of the authentication details
that allow your Go code to access the API - such as the base URL and token ID.
Once we have a base Provider, we inject it as a dependency into each OpenStack
service. For example, in order to work with the Compute API, we need a Compute
service client. This can be created like so:
```go
client, err := clientconfig.NewServiceClient("compute", opts)
```
**Without `gophercloud/utils`**
> *Note*
> gophercloud doesn't provide support for `clouds.yaml` file so you need to
> implement this functionality yourself if you don't wish to use
> `gophercloud/utils`.
You can also generate a "Provider" struct without using the `clientconfig`
package from `gophercloud/utils`. To do this, you can either pass in your
credentials explicitly or tell Gophercloud to use environment variables:
```go
import (
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/openstack"
) )
// Option 1: Pass in the values yourself // Option 1: Pass in the values yourself
...@@ -97,34 +121,29 @@ Once you have the `opts` variable, you can pass it in and get back a ...@@ -97,34 +121,29 @@ Once you have the `opts` variable, you can pass it in and get back a
provider, err := openstack.AuthenticatedClient(opts) provider, err := openstack.AuthenticatedClient(opts)
``` ```
The `ProviderClient` is the top-level client that all of your OpenStack services As above, you can then use this provider client to generate a service client
derive from. The provider contains all of the authentication details that allow for a particular OpenStack service:
your Go code to access the API - such as the base URL and token ID.
### Provision a server
Once we have a base Provider, we inject it as a dependency into each OpenStack
service. In order to work with the Compute API, we need a Compute service
client; which can be created like so:
```go ```go
client, err := openstack.NewComputeV2(provider, gophercloud.EndpointOpts{ client, err := openstack.NewComputeV2(provider, gophercloud.EndpointOpts{
Region: os.Getenv("OS_REGION_NAME"), Region: os.Getenv("OS_REGION_NAME"),
}) })
``` ```
We then use this `client` for any Compute API operation we want. In our case, ### Provision a server
we want to provision a new server - so we invoke the `Create` method and pass
in the flavor ID (hardware specification) and image ID (operating system) we're We can use the Compute service client generated above for any Compute API
interested in: operation we want. In our case, we want to provision a new server. To do this,
we invoke the `Create` method and pass in the flavor ID (hardware
specification) and image ID (operating system) we're interested in:
```go ```go
import "github.com/gophercloud/gophercloud/openstack/compute/v2/servers" import "github.com/gophercloud/gophercloud/openstack/compute/v2/servers"
server, err := servers.Create(client, servers.CreateOpts{ server, err := servers.Create(client, servers.CreateOpts{
Name: "My new server!", Name: "My new server!",
FlavorRef: "flavor_id", FlavorRef: "flavor_id",
ImageRef: "image_id", ImageRef: "image_id",
}).Extract() }).Extract()
``` ```
...@@ -138,7 +157,11 @@ Have a look at the [FAQ](./docs/FAQ.md) for some tips on customizing the way Gop ...@@ -138,7 +157,11 @@ Have a look at the [FAQ](./docs/FAQ.md) for some tips on customizing the way Gop
## Backwards-Compatibility Guarantees ## Backwards-Compatibility Guarantees
None. Vendor it and write tests covering the parts you use. Gophercloud versioning follows [semver](https://semver.org/spec/v2.0.0.html).
Before `v1.0.0`, there were no guarantees. Starting with v1, there will be no breaking changes within a major release.
See the [Release instructions](./RELEASE.md).
## Contributing ## Contributing
...@@ -148,19 +171,3 @@ See the [contributing guide](./.github/CONTRIBUTING.md). ...@@ -148,19 +171,3 @@ See the [contributing guide](./.github/CONTRIBUTING.md).
If you're struggling with something or have spotted a potential bug, feel free If you're struggling with something or have spotted a potential bug, feel free
to submit an issue to our [bug tracker](https://github.com/gophercloud/gophercloud/issues). to submit an issue to our [bug tracker](https://github.com/gophercloud/gophercloud/issues).
## Thank You
We'd like to extend special thanks and appreciation to the following:
### OpenLab
<a href="http://openlabtesting.org/"><img src="./docs/assets/openlab.png" width="600px"></a>
OpenLab is providing a full CI environment to test each PR and merge for a variety of OpenStack releases.
### VEXXHOST
<a href="https://vexxhost.com/"><img src="./docs/assets/vexxhost.png" width="600px"></a>
VEXXHOST is providing their services to assist with the development and testing of Gophercloud.
# Gophercloud release
## Contributions
### The semver label
Gophercloud follows [semver](https://semver.org/).
Each Pull request must have a label indicating its impact on the API:
* `semver:patch` for changes that don't impact the API
* `semver:minor` for changes that impact the API in a backwards-compatible fashion
* `semver:major` for changes that introduce a breaking change in the API
Automation prevents merges if the label is not present.
### Metadata
The release notes for a given release are generated based on the PR title: make
sure that the PR title is descriptive.
## Release of a new version
Requirements:
* [`gh`](https://github.com/cli/cli)
* [`jq`](https://stedolan.github.io/jq/)
### Step 1: Collect all PRs since the last release
Supposing that the base release is `v1.2.0`:
```
for commit_sha in $(git log --pretty=format:"%h" v1.2.0..HEAD); do
gh pr list --search "$commit_sha" --state merged --json number,title,labels,url
done | jq '.[]' | jq --slurp 'unique_by(.number)' > prs.json
```
This JSON file will be useful later.
### Step 2: Determine the version
In order to determine the version of the next release, we first check that no incompatible change is detected in the code that has been merged since the last release. This step can be automated with the `gorelease` tool:
```shell
gorelease | grep -B2 -A0 '^## incompatible changes'
```
If the tool detects incompatible changes outside a `testing` package, then the bump is major.
Next, we check all PRs merged since the last release using the file `prs.json` that we generated above.
* Find PRs labeled with `semver:major`: `jq 'map(select(contains({labels: [{name: "semver:major"}]}) ))' prs.json`
* Find PRs labeled with `semver:minor`: `jq 'map(select(contains({labels: [{name: "semver:minor"}]}) ))' prs.json`
The highest semver descriptor determines the release bump.
### Step 3: Release notes and version string
Once all PRs have a sensible title, generate the release notes:
```shell
jq -r '.[] | "* [GH-\(.number)](\(.url)) \(.title)"' prs.json
```
Add that to the top of `CHANGELOG.md`. Also add any information that could be useful to consumers willing to upgrade.
**Set the new version string in the `DefaultUserAgent` constant in `provider_client.go`.**
Create a PR with these two changes. The new PR should be labeled with the semver label corresponding to the type of bump.
### Step 3: Git tag and Github release
The Go mod system relies on Git tags. In order to simulate a review mechanism, we rely on Github to create the tag through the Release mechanism.
* [Prepare a new release](https://github.com/gophercloud/gophercloud/releases/new)
* Let Github generate the release notes by clicking on Generate release notes
* Click on **Save draft**
* Ask another Gophercloud maintainer to review and publish the release
_Note: never change a release or force-push a tag. Tags are almost immediately picked up by the Go proxy and changing the commit it points to will be detected as tampering._
...@@ -12,20 +12,20 @@ provider. ...@@ -12,20 +12,20 @@ provider.
An example of manually providing authentication information: An example of manually providing authentication information:
opts := gophercloud.AuthOptions{ opts := gophercloud.AuthOptions{
IdentityEndpoint: "https://openstack.example.com:5000/v2.0", IdentityEndpoint: "https://openstack.example.com:5000/v2.0",
Username: "{username}", Username: "{username}",
Password: "{password}", Password: "{password}",
TenantID: "{tenant_id}", TenantID: "{tenant_id}",
} }
provider, err := openstack.AuthenticatedClient(opts) provider, err := openstack.AuthenticatedClient(opts)
An example of using AuthOptionsFromEnv(), where the environment variables can An example of using AuthOptionsFromEnv(), where the environment variables can
be read from a file, such as a standard openrc file: be read from a file, such as a standard openrc file:
opts, err := openstack.AuthOptionsFromEnv() opts, err := openstack.AuthOptionsFromEnv()
provider, err := openstack.AuthenticatedClient(opts) provider, err := openstack.AuthenticatedClient(opts)
*/ */
type AuthOptions struct { type AuthOptions struct {
// IdentityEndpoint specifies the HTTP endpoint that is required to work with // IdentityEndpoint specifies the HTTP endpoint that is required to work with
......
...@@ -3,7 +3,7 @@ Package gophercloud provides a multi-vendor interface to OpenStack-compatible ...@@ -3,7 +3,7 @@ Package gophercloud provides a multi-vendor interface to OpenStack-compatible
clouds. The library has a three-level hierarchy: providers, services, and clouds. The library has a three-level hierarchy: providers, services, and
resources. resources.
Authenticating with Providers # Authenticating with Providers
Provider structs represent the cloud providers that offer and manage a Provider structs represent the cloud providers that offer and manage a
collection of services. You will generally want to create one Provider collection of services. You will generally want to create one Provider
...@@ -49,7 +49,7 @@ instead of "project". ...@@ -49,7 +49,7 @@ instead of "project".
opts, err := openstack.AuthOptionsFromEnv() opts, err := openstack.AuthOptionsFromEnv()
provider, err := openstack.AuthenticatedClient(opts) provider, err := openstack.AuthenticatedClient(opts)
Service Clients # Service Clients
Service structs are specific to a provider and handle all of the logic and Service structs are specific to a provider and handle all of the logic and
operations for a particular OpenStack service. Examples of services include: operations for a particular OpenStack service. Examples of services include:
...@@ -60,7 +60,7 @@ pass in the parent provider, like so: ...@@ -60,7 +60,7 @@ pass in the parent provider, like so:
client, err := openstack.NewComputeV2(provider, opts) client, err := openstack.NewComputeV2(provider, opts)
Resources # Resources
Resource structs are the domain models that services make use of in order Resource structs are the domain models that services make use of in order
to work with and represent the state of API resources: to work with and represent the state of API resources:
...@@ -144,6 +144,5 @@ An example retry backoff function, which respects the 429 HTTP response code and ...@@ -144,6 +144,5 @@ An example retry backoff function, which respects the 429 HTTP response code and
return nil return nil
} }
*/ */
package gophercloud package gophercloud
...@@ -156,11 +156,21 @@ type ErrDefault500 struct { ...@@ -156,11 +156,21 @@ type ErrDefault500 struct {
ErrUnexpectedResponseCode ErrUnexpectedResponseCode
} }
// ErrDefault502 is the default error type returned on a 502 HTTP response code.
type ErrDefault502 struct {
ErrUnexpectedResponseCode
}
// ErrDefault503 is the default error type returned on a 503 HTTP response code. // ErrDefault503 is the default error type returned on a 503 HTTP response code.
type ErrDefault503 struct { type ErrDefault503 struct {
ErrUnexpectedResponseCode ErrUnexpectedResponseCode
} }
// ErrDefault504 is the default error type returned on a 504 HTTP response code.
type ErrDefault504 struct {
ErrUnexpectedResponseCode
}
func (e ErrDefault400) Error() string { func (e ErrDefault400) Error() string {
e.DefaultErrString = fmt.Sprintf( e.DefaultErrString = fmt.Sprintf(
"Bad request with: [%s %s], error message: %s", "Bad request with: [%s %s], error message: %s",
...@@ -179,7 +189,11 @@ func (e ErrDefault403) Error() string { ...@@ -179,7 +189,11 @@ func (e ErrDefault403) Error() string {
return e.choseErrString() return e.choseErrString()
} }
func (e ErrDefault404) Error() string { func (e ErrDefault404) Error() string {
return "Resource not found" e.DefaultErrString = fmt.Sprintf(
"Resource not found: [%s %s], error message: %s",
e.Method, e.URL, e.Body,
)
return e.choseErrString()
} }
func (e ErrDefault405) Error() string { func (e ErrDefault405) Error() string {
return "Method not allowed" return "Method not allowed"
...@@ -194,10 +208,16 @@ func (e ErrDefault429) Error() string { ...@@ -194,10 +208,16 @@ func (e ErrDefault429) Error() string {
func (e ErrDefault500) Error() string { func (e ErrDefault500) Error() string {
return "Internal Server Error" return "Internal Server Error"
} }
func (e ErrDefault502) Error() string {
return "Bad Gateway"
}
func (e ErrDefault503) Error() string { func (e ErrDefault503) Error() string {
return "The service is currently unable to handle the request due to a temporary" + return "The service is currently unable to handle the request due to a temporary" +
" overloading or maintenance. This is a temporary condition. Try again later." " overloading or maintenance. This is a temporary condition. Try again later."
} }
func (e ErrDefault504) Error() string {
return "Gateway Timeout"
}
// Err400er is the interface resource error types implement to override the error message // Err400er is the interface resource error types implement to override the error message
// from a 400 error. // from a 400 error.
...@@ -253,12 +273,24 @@ type Err500er interface { ...@@ -253,12 +273,24 @@ type Err500er interface {
Error500(ErrUnexpectedResponseCode) error Error500(ErrUnexpectedResponseCode) error
} }
// Err502er is the interface resource error types implement to override the error message
// from a 502 error.
type Err502er interface {
Error502(ErrUnexpectedResponseCode) error
}
// Err503er is the interface resource error types implement to override the error message // Err503er is the interface resource error types implement to override the error message
// from a 503 error. // from a 503 error.
type Err503er interface { type Err503er interface {
Error503(ErrUnexpectedResponseCode) error Error503(ErrUnexpectedResponseCode) error
} }
// Err504er is the interface resource error types implement to override the error message
// from a 504 error.
type Err504er interface {
Error504(ErrUnexpectedResponseCode) error
}
// ErrTimeOut is the error type returned when an operations times out. // ErrTimeOut is the error type returned when an operations times out.
type ErrTimeOut struct { type ErrTimeOut struct {
BaseError BaseError
...@@ -273,10 +305,11 @@ func (e ErrTimeOut) Error() string { ...@@ -273,10 +305,11 @@ func (e ErrTimeOut) Error() string {
type ErrUnableToReauthenticate struct { type ErrUnableToReauthenticate struct {
BaseError BaseError
ErrOriginal error ErrOriginal error
ErrReauth error
} }
func (e ErrUnableToReauthenticate) Error() string { func (e ErrUnableToReauthenticate) Error() string {
e.DefaultErrString = fmt.Sprintf("Unable to re-authenticate: %s", e.ErrOriginal) e.DefaultErrString = fmt.Sprintf("Unable to re-authenticate: %s: %s", e.ErrOriginal, e.ErrReauth)
return e.choseErrString() return e.choseErrString()
} }
......
module github.com/gophercloud/gophercloud module github.com/gophercloud/gophercloud
go 1.13 go 1.14
require ( require (
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v2 v2.3.0
) )
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM=
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
...@@ -46,6 +46,7 @@ func AuthOptionsFromEnv() (gophercloud.AuthOptions, error) { ...@@ -46,6 +46,7 @@ func AuthOptionsFromEnv() (gophercloud.AuthOptions, error) {
applicationCredentialID := os.Getenv("OS_APPLICATION_CREDENTIAL_ID") applicationCredentialID := os.Getenv("OS_APPLICATION_CREDENTIAL_ID")
applicationCredentialName := os.Getenv("OS_APPLICATION_CREDENTIAL_NAME") applicationCredentialName := os.Getenv("OS_APPLICATION_CREDENTIAL_NAME")
applicationCredentialSecret := os.Getenv("OS_APPLICATION_CREDENTIAL_SECRET") applicationCredentialSecret := os.Getenv("OS_APPLICATION_CREDENTIAL_SECRET")
systemScope := os.Getenv("OS_SYSTEM_SCOPE")
// If OS_PROJECT_ID is set, overwrite tenantID with the value. // If OS_PROJECT_ID is set, overwrite tenantID with the value.
if v := os.Getenv("OS_PROJECT_ID"); v != "" { if v := os.Getenv("OS_PROJECT_ID"); v != "" {
...@@ -109,6 +110,13 @@ func AuthOptionsFromEnv() (gophercloud.AuthOptions, error) { ...@@ -109,6 +110,13 @@ func AuthOptionsFromEnv() (gophercloud.AuthOptions, error) {
} }
} }
var scope *gophercloud.AuthScope
if systemScope == "all" {
scope = &gophercloud.AuthScope{
System: true,
}
}
ao := gophercloud.AuthOptions{ ao := gophercloud.AuthOptions{
IdentityEndpoint: authURL, IdentityEndpoint: authURL,
UserID: userID, UserID: userID,
...@@ -122,6 +130,7 @@ func AuthOptionsFromEnv() (gophercloud.AuthOptions, error) { ...@@ -122,6 +130,7 @@ func AuthOptionsFromEnv() (gophercloud.AuthOptions, error) {
ApplicationCredentialID: applicationCredentialID, ApplicationCredentialID: applicationCredentialID,
ApplicationCredentialName: applicationCredentialName, ApplicationCredentialName: applicationCredentialName,
ApplicationCredentialSecret: applicationCredentialSecret, ApplicationCredentialSecret: applicationCredentialSecret,
Scope: scope,
} }
return ao, nil return ao, nil
......
...@@ -369,7 +369,7 @@ func NewBareMetalV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointO ...@@ -369,7 +369,7 @@ func NewBareMetalV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointO
// NewBareMetalIntrospectionV1 creates a ServiceClient that may be used with the v1 // NewBareMetalIntrospectionV1 creates a ServiceClient that may be used with the v1
// bare metal introspection package. // bare metal introspection package.
func NewBareMetalIntrospectionV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { func NewBareMetalIntrospectionV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) {
return initClientOpts(client, eo, "baremetal-inspector") return initClientOpts(client, eo, "baremetal-introspection")
} }
// NewObjectStorageV1 creates a ServiceClient that may be used with the v1 // NewObjectStorageV1 creates a ServiceClient that may be used with the v1
......
...@@ -11,6 +11,26 @@ Example to List Servers ...@@ -11,6 +11,26 @@ Example to List Servers
AllTenants: true, AllTenants: true,
} }
allPages, err := servers.ListSimple(computeClient, listOpts).AllPages()
if err != nil {
panic(err)
}
allServers, err := servers.ExtractServers(allPages)
if err != nil {
panic(err)
}
for _, server := range allServers {
fmt.Printf("%+v\n", server)
}
Example to List Detail Servers
listOpts := servers.ListOpts{
AllTenants: true,
}
allPages, err := servers.List(computeClient, listOpts).AllPages() allPages, err := servers.List(computeClient, listOpts).AllPages()
if err != nil { if err != nil {
panic(err) panic(err)
......
...@@ -83,6 +83,9 @@ type ListOpts struct { ...@@ -83,6 +83,9 @@ type ListOpts struct {
// This requires the client to be set to microversion 2.26 or later. // This requires the client to be set to microversion 2.26 or later.
// NotTagsAny filters on specific server tags. At least one of the tags must be absent for the server. // NotTagsAny filters on specific server tags. At least one of the tags must be absent for the server.
NotTagsAny string `q:"not-tags-any"` NotTagsAny string `q:"not-tags-any"`
// Display servers based on their availability zone (Admin only until microversion 2.82).
AvailabilityZone string `q:"availability_zone"`
} }
// ToServerListQuery formats a ListOpts into a query string. // ToServerListQuery formats a ListOpts into a query string.
...@@ -91,7 +94,22 @@ func (opts ListOpts) ToServerListQuery() (string, error) { ...@@ -91,7 +94,22 @@ func (opts ListOpts) ToServerListQuery() (string, error) {
return q.String(), err return q.String(), err
} }
// List makes a request against the API to list servers accessible to you. // ListSimple makes a request against the API to list servers accessible to you.
func ListSimple(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager {
url := listURL(client)
if opts != nil {
query, err := opts.ToServerListQuery()
if err != nil {
return pagination.Pager{Err: err}
}
url += query
}
return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page {
return ServerPage{pagination.LinkedPageBase{PageResult: r}}
})
}
// List makes a request against the API to list servers details accessible to you.
func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager {
url := listDetailURL(client) url := listDetailURL(client)
if opts != nil { if opts != nil {
...@@ -125,6 +143,13 @@ type Network struct { ...@@ -125,6 +143,13 @@ type Network struct {
// FixedIP specifies a fixed IPv4 address to be used on this network. // FixedIP specifies a fixed IPv4 address to be used on this network.
FixedIP string FixedIP string
// Tag may contain an optional device role tag for the server's virtual
// network interface. This can be used to identify network interfaces when
// multiple networks are connected to one server.
//
// Requires microversion 2.32 through 2.36 or 2.42 or later.
Tag string
} }
// Personality is an array of files that are injected into the server at launch. // Personality is an array of files that are injected into the server at launch.
...@@ -258,6 +283,9 @@ func (opts CreateOpts) ToServerCreateMap() (map[string]interface{}, error) { ...@@ -258,6 +283,9 @@ func (opts CreateOpts) ToServerCreateMap() (map[string]interface{}, error) {
if net.FixedIP != "" { if net.FixedIP != "" {
networks[i]["fixed_ip"] = net.FixedIP networks[i]["fixed_ip"] = net.FixedIP
} }
if net.Tag != "" {
networks[i]["tag"] = net.Tag
}
} }
b["networks"] = networks b["networks"] = networks
} }
...@@ -399,19 +427,19 @@ func (opts RebootOpts) ToServerRebootMap() (map[string]interface{}, error) { ...@@ -399,19 +427,19 @@ func (opts RebootOpts) ToServerRebootMap() (map[string]interface{}, error) {
} }
/* /*
Reboot requests that a given server reboot. Reboot requests that a given server reboot.
Two methods exist for rebooting a server: Two methods exist for rebooting a server:
HardReboot (aka PowerCycle) starts the server instance by physically cutting HardReboot (aka PowerCycle) starts the server instance by physically cutting
power to the machine, or if a VM, terminating it at the hypervisor level. power to the machine, or if a VM, terminating it at the hypervisor level.
It's done. Caput. Full stop. It's done. Caput. Full stop.
Then, after a brief while, power is restored or the VM instance restarted. Then, after a brief while, power is restored or the VM instance restarted.
SoftReboot (aka OSReboot) simply tells the OS to restart under its own SoftReboot (aka OSReboot) simply tells the OS to restart under its own
procedure. procedure.
E.g., in Linux, asking it to enter runlevel 6, or executing E.g., in Linux, asking it to enter runlevel 6, or executing
"sudo shutdown -r now", or by asking Windows to rtart the machine. "sudo shutdown -r now", or by asking Windows to rtart the machine.
*/ */
func Reboot(client *gophercloud.ServiceClient, id string, opts RebootOptsBuilder) (r ActionResult) { func Reboot(client *gophercloud.ServiceClient, id string, opts RebootOptsBuilder) (r ActionResult) {
b, err := opts.ToServerRebootMap() b, err := opts.ToServerRebootMap()
......
...@@ -99,7 +99,8 @@ type GetPasswordResult struct { ...@@ -99,7 +99,8 @@ type GetPasswordResult struct {
// If privateKey != nil the password is decrypted with the private key. // If privateKey != nil the password is decrypted with the private key.
// If privateKey == nil the encrypted password is returned and can be decrypted // If privateKey == nil the encrypted password is returned and can be decrypted
// with: // with:
// echo '<pwd>' | base64 -D | openssl rsautl -decrypt -inkey <private_key> //
// echo '<pwd>' | base64 -D | openssl rsautl -decrypt -inkey <private_key>
func (r GetPasswordResult) ExtractPassword(privateKey *rsa.PrivateKey) (string, error) { func (r GetPasswordResult) ExtractPassword(privateKey *rsa.PrivateKey) (string, error) {
var s struct { var s struct {
Password string `json:"password"` Password string `json:"password"`
...@@ -221,6 +222,12 @@ type Server struct { ...@@ -221,6 +222,12 @@ type Server struct {
// Tags is a slice/list of string tags in a server. // Tags is a slice/list of string tags in a server.
// The requires microversion 2.26 or later. // The requires microversion 2.26 or later.
Tags *[]string `json:"tags"` Tags *[]string `json:"tags"`
// ServerGroups is a slice of strings containing the UUIDs of the
// server groups to which the server belongs. Currently this can
// contain at most one entry.
// New in microversion 2.71
ServerGroups *[]string `json:"server_groups"`
} }
type AttachedVolume struct { type AttachedVolume struct {
...@@ -270,6 +277,10 @@ type ServerPage struct { ...@@ -270,6 +277,10 @@ type ServerPage struct {
// IsEmpty returns true if a page contains no Server results. // IsEmpty returns true if a page contains no Server results.
func (r ServerPage) IsEmpty() (bool, error) { func (r ServerPage) IsEmpty() (bool, error) {
if r.StatusCode == 204 {
return true, nil
}
s, err := ExtractServers(r) s, err := ExtractServers(r)
return len(s) == 0, err return len(s) == 0, err
} }
...@@ -378,6 +389,10 @@ type AddressPage struct { ...@@ -378,6 +389,10 @@ type AddressPage struct {
// IsEmpty returns true if an AddressPage contains no networks. // IsEmpty returns true if an AddressPage contains no networks.
func (r AddressPage) IsEmpty() (bool, error) { func (r AddressPage) IsEmpty() (bool, error) {
if r.StatusCode == 204 {
return true, nil
}
addresses, err := ExtractAddresses(r) addresses, err := ExtractAddresses(r)
return len(addresses) == 0, err return len(addresses) == 0, err
} }
...@@ -403,6 +418,10 @@ type NetworkAddressPage struct { ...@@ -403,6 +418,10 @@ type NetworkAddressPage struct {
// IsEmpty returns true if a NetworkAddressPage contains no addresses. // IsEmpty returns true if a NetworkAddressPage contains no addresses.
func (r NetworkAddressPage) IsEmpty() (bool, error) { func (r NetworkAddressPage) IsEmpty() (bool, error) {
if r.StatusCode == 204 {
return true, nil
}
addresses, err := ExtractNetworkAddresses(r) addresses, err := ExtractNetworkAddresses(r)
return len(addresses) == 0, err return len(addresses) == 0, err
} }
......
...@@ -27,6 +27,10 @@ type TenantPage struct { ...@@ -27,6 +27,10 @@ type TenantPage struct {
// IsEmpty determines whether or not a page of Tenants contains any results. // IsEmpty determines whether or not a page of Tenants contains any results.
func (r TenantPage) IsEmpty() (bool, error) { func (r TenantPage) IsEmpty() (bool, error) {
if r.StatusCode == 204 {
return true, nil
}
tenants, err := ExtractTenants(r) tenants, err := ExtractTenants(r)
return len(tenants) == 0, err return len(tenants) == 0, err
} }
......
...@@ -89,7 +89,7 @@ func Create(client *gophercloud.ServiceClient, auth AuthOptionsBuilder) (r Creat ...@@ -89,7 +89,7 @@ func Create(client *gophercloud.ServiceClient, auth AuthOptionsBuilder) (r Creat
} }
resp, err := client.Post(CreateURL(client), b, &r.Body, &gophercloud.RequestOpts{ resp, err := client.Post(CreateURL(client), b, &r.Body, &gophercloud.RequestOpts{
OkCodes: []int{200, 203}, OkCodes: []int{200, 203},
MoreHeaders: map[string]string{"X-Auth-Token": ""}, OmitHeaders: []string{"X-Auth-Token"},
}) })
_, r.Header, r.Err = gophercloud.ParseResponse(resp, err) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
return return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment