From 9351b0731006f13bf00fa25a74529126d84846ae Mon Sep 17 00:00:00 2001 From: Qiu Jian Date: Mon, 12 Aug 2019 22:02:19 +0800 Subject: [PATCH] fix: cloudregion and zone list filter by providers/brands --- pkg/apigateway/app/doc.go | 15 +++++++ pkg/apigateway/clientman/doc.go | 15 +++++++ pkg/apigateway/constants/doc.go | 15 +++++++ pkg/apigateway/handler/middleware.go | 14 +++++++ pkg/apigateway/handler/request.go | 14 +++++++ pkg/apigateway/options/doc.go | 15 +++++++ pkg/apigateway/policy/doc.go | 15 +++++++ pkg/apigateway/service/doc.go | 15 +++++++ pkg/apis/compute/elasticcache_const.go | 14 +++++++ pkg/compute/models/cloudregions.go | 42 +++++++++++++++---- pkg/compute/models/cloudsyncelasticcache.go | 14 +++++++ pkg/compute/models/elasticcache_accounts.go | 14 +++++++ pkg/compute/models/elasticcache_acls.go | 14 +++++++ pkg/compute/models/elasticcache_backups.go | 14 +++++++ pkg/compute/models/elasticcache_instances.go | 14 +++++++ pkg/compute/models/elasticcache_parameters.go | 14 +++++++ pkg/compute/models/zones.go | 19 +++++---- pkg/multicloud/aliyun/elasticcache_account.go | 14 +++++++ pkg/multicloud/aliyun/elasticcache_acl.go | 14 +++++++ pkg/multicloud/aliyun/elasticcache_backup.go | 14 +++++++ .../aliyun/elasticcache_instance.go | 14 +++++++ .../aliyun/elasticcache_parameter.go | 14 +++++++ pkg/multicloud/aliyun/shell/elasticcache.go | 14 +++++++ pkg/multicloud/aliyun/storage.go | 14 +++++++ pkg/multicloud/aliyun/utils.go | 14 +++++++ pkg/multicloud/bucket_base.go | 14 +++++++ pkg/multicloud/elasticcache_base.go | 14 +++++++ .../huawei/client/modules/mod_elasticcache.go | 14 +++++++ pkg/multicloud/huawei/dbinstance.go | 14 +++++++ pkg/multicloud/huawei/dbinstance_account.go | 14 +++++++ pkg/multicloud/huawei/dbinstance_backup.go | 14 +++++++ pkg/multicloud/huawei/dbinstance_database.go | 14 +++++++ pkg/multicloud/huawei/dbinstance_parameter.go | 14 +++++++ pkg/multicloud/huawei/dbinstance_privilege.go | 14 +++++++ pkg/multicloud/huawei/elasticcache_account.go | 14 +++++++ pkg/multicloud/huawei/elasticcache_backup.go | 14 +++++++ .../huawei/elasticcache_instance.go | 14 +++++++ .../huawei/elasticcache_parameter.go | 14 +++++++ pkg/multicloud/huawei/shell/elasticcache.go | 14 +++++++ pkg/multicloud/objectstore/shell/minio.go | 14 +++++++ pkg/util/fileutils2/seeker.go | 14 +++++++ pkg/util/fileutils2/seeker_test.go | 14 +++++++ 42 files changed, 612 insertions(+), 15 deletions(-) create mode 100644 pkg/apigateway/app/doc.go create mode 100644 pkg/apigateway/clientman/doc.go create mode 100644 pkg/apigateway/constants/doc.go create mode 100644 pkg/apigateway/options/doc.go create mode 100644 pkg/apigateway/policy/doc.go create mode 100644 pkg/apigateway/service/doc.go diff --git a/pkg/apigateway/app/doc.go b/pkg/apigateway/app/doc.go new file mode 100644 index 0000000000..cda94f263b --- /dev/null +++ b/pkg/apigateway/app/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package app // import "yunion.io/x/onecloud/pkg/apigateway/app" diff --git a/pkg/apigateway/clientman/doc.go b/pkg/apigateway/clientman/doc.go new file mode 100644 index 0000000000..a59851a785 --- /dev/null +++ b/pkg/apigateway/clientman/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package clientman // import "yunion.io/x/onecloud/pkg/apigateway/clientman" diff --git a/pkg/apigateway/constants/doc.go b/pkg/apigateway/constants/doc.go new file mode 100644 index 0000000000..8b9a5ff44e --- /dev/null +++ b/pkg/apigateway/constants/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package constants // import "yunion.io/x/onecloud/pkg/apigateway/constants" diff --git a/pkg/apigateway/handler/middleware.go b/pkg/apigateway/handler/middleware.go index ce22318328..f6d3e4c78d 100644 --- a/pkg/apigateway/handler/middleware.go +++ b/pkg/apigateway/handler/middleware.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package handler import ( diff --git a/pkg/apigateway/handler/request.go b/pkg/apigateway/handler/request.go index 8cf52d10df..b8c42228e9 100644 --- a/pkg/apigateway/handler/request.go +++ b/pkg/apigateway/handler/request.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package handler import ( diff --git a/pkg/apigateway/options/doc.go b/pkg/apigateway/options/doc.go new file mode 100644 index 0000000000..5a0cb9f9f6 --- /dev/null +++ b/pkg/apigateway/options/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package options // import "yunion.io/x/onecloud/pkg/apigateway/options" diff --git a/pkg/apigateway/policy/doc.go b/pkg/apigateway/policy/doc.go new file mode 100644 index 0000000000..e806f18f16 --- /dev/null +++ b/pkg/apigateway/policy/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package policy // import "yunion.io/x/onecloud/pkg/apigateway/policy" diff --git a/pkg/apigateway/service/doc.go b/pkg/apigateway/service/doc.go new file mode 100644 index 0000000000..c8f7dee9b7 --- /dev/null +++ b/pkg/apigateway/service/doc.go @@ -0,0 +1,15 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package service // import "yunion.io/x/onecloud/pkg/apigateway/service" diff --git a/pkg/apis/compute/elasticcache_const.go b/pkg/apis/compute/elasticcache_const.go index 736f1b61e1..0a0941ef1a 100644 --- a/pkg/apis/compute/elasticcache_const.go +++ b/pkg/apis/compute/elasticcache_const.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package compute const ( diff --git a/pkg/compute/models/cloudregions.go b/pkg/compute/models/cloudregions.go index 2dc68037c0..01b6ef83a7 100644 --- a/pkg/compute/models/cloudregions.go +++ b/pkg/compute/models/cloudregions.go @@ -539,15 +539,43 @@ func getCloudRegionIdByDomainId(domainId string) *sqlchemy.SSubQuery { return sqlchemy.Union(q1, q2).Query().SubQuery() } +func queryCloudregionIdsByProviders(providerField string, providerStrs []string) *sqlchemy.SQuery { + q := CloudregionManager.Query("id") + oneCloud, providers := splitProviders(providerStrs) + conds := make([]sqlchemy.ICondition, 0) + if len(providers) > 0 { + cloudproviders := CloudproviderManager.Query().SubQuery() + cloudaccounts := CloudaccountManager.Query().SubQuery() + subq := CloudproviderRegionManager.Query("cloudregion_id") + subq = subq.Join(cloudproviders, sqlchemy.Equals(subq.Field("cloudprovider_id"), cloudproviders.Field("id"))) + subq = subq.Join(cloudaccounts, sqlchemy.Equals(cloudproviders.Field("cloudaccount_id"), cloudaccounts.Field("id"))) + subq = subq.Filter(sqlchemy.In(cloudaccounts.Field(providerField), providers)) + conds = append(conds, sqlchemy.In(q.Field("id"), subq.SubQuery())) + } + if oneCloud { + conds = append(conds, sqlchemy.IsNullOrEmpty(q.Field("provider"))) + } + if len(conds) == 1 { + q = q.Filter(conds[0]) + } else if len(conds) == 2 { + q = q.Filter(sqlchemy.OR(conds...)) + } + return q +} + func (manager *SCloudregionManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*sqlchemy.SQuery, error) { - providerStr := jsonutils.GetAnyString(query, []string{"provider"}) - if len(providerStr) > 0 { + providerStrs := jsonutils.GetQueryStringArray(query, "provider") + if len(providerStrs) > 0 { query.(*jsonutils.JSONDict).Remove("provider") - if providerStr == api.CLOUD_PROVIDER_ONECLOUD { - q = q.IsNullOrEmpty("provider") - } else { - q = q.Equals("provider", providerStr) - } + subq := queryCloudregionIdsByProviders("provider", providerStrs) + q = q.In("id", subq.SubQuery()) + } + + brandStrs := jsonutils.GetQueryStringArray(query, "brand") + if len(brandStrs) > 0 { + query.(*jsonutils.JSONDict).Remove("brand") + subq := queryCloudregionIdsByProviders("brand", brandStrs) + q = q.In("id", subq.SubQuery()) } q, err := manager.SEnabledStatusStandaloneResourceBaseManager.ListItemFilter(ctx, q, userCred, query) diff --git a/pkg/compute/models/cloudsyncelasticcache.go b/pkg/compute/models/cloudsyncelasticcache.go index ef39cc767c..c8db477482 100644 --- a/pkg/compute/models/cloudsyncelasticcache.go +++ b/pkg/compute/models/cloudsyncelasticcache.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package models import ( diff --git a/pkg/compute/models/elasticcache_accounts.go b/pkg/compute/models/elasticcache_accounts.go index 9c2141a62d..4bfdff7079 100644 --- a/pkg/compute/models/elasticcache_accounts.go +++ b/pkg/compute/models/elasticcache_accounts.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package models import ( diff --git a/pkg/compute/models/elasticcache_acls.go b/pkg/compute/models/elasticcache_acls.go index 399167ec52..1dc358de49 100644 --- a/pkg/compute/models/elasticcache_acls.go +++ b/pkg/compute/models/elasticcache_acls.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package models import ( diff --git a/pkg/compute/models/elasticcache_backups.go b/pkg/compute/models/elasticcache_backups.go index 61437c4253..7dfba2f5bd 100644 --- a/pkg/compute/models/elasticcache_backups.go +++ b/pkg/compute/models/elasticcache_backups.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package models import ( diff --git a/pkg/compute/models/elasticcache_instances.go b/pkg/compute/models/elasticcache_instances.go index b989d08262..c9ae828e18 100644 --- a/pkg/compute/models/elasticcache_instances.go +++ b/pkg/compute/models/elasticcache_instances.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package models import ( diff --git a/pkg/compute/models/elasticcache_parameters.go b/pkg/compute/models/elasticcache_parameters.go index 3251746939..eefac6f9ce 100644 --- a/pkg/compute/models/elasticcache_parameters.go +++ b/pkg/compute/models/elasticcache_parameters.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package models import ( diff --git a/pkg/compute/models/zones.go b/pkg/compute/models/zones.go index e9fdd8d8b0..7f67493a48 100644 --- a/pkg/compute/models/zones.go +++ b/pkg/compute/models/zones.go @@ -588,15 +588,18 @@ func (manager *SZoneManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQu subq := CloudproviderRegionManager.QueryRelatedRegionIds(accountStr) q = q.In("cloudregion_id", subq) } - providerStr, _ := query.GetString("provider") - if len(providerStr) > 0 { - subq := CloudregionManager.Query("id") - if providerStr == api.CLOUD_PROVIDER_ONECLOUD { - subq = subq.IsNullOrEmpty("provider") - } else { - subq = subq.Equals("provider", providerStr) - } + providerStrs := jsonutils.GetQueryStringArray(query, "provider") + if len(providerStrs) > 0 { + query.(*jsonutils.JSONDict).Remove("provider") + subq := queryCloudregionIdsByProviders("provider", providerStrs) + q = q.In("cloudregion_id", subq.SubQuery()) + } + + brandStrs := jsonutils.GetQueryStringArray(query, "brand") + if len(brandStrs) > 0 { + query.(*jsonutils.JSONDict).Remove("brand") + subq := queryCloudregionIdsByProviders("brand", brandStrs) q = q.In("cloudregion_id", subq.SubQuery()) } diff --git a/pkg/multicloud/aliyun/elasticcache_account.go b/pkg/multicloud/aliyun/elasticcache_account.go index fd22152862..bba6ac4078 100644 --- a/pkg/multicloud/aliyun/elasticcache_account.go +++ b/pkg/multicloud/aliyun/elasticcache_account.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package aliyun import ( diff --git a/pkg/multicloud/aliyun/elasticcache_acl.go b/pkg/multicloud/aliyun/elasticcache_acl.go index b1a98ce852..0f2b72ad26 100644 --- a/pkg/multicloud/aliyun/elasticcache_acl.go +++ b/pkg/multicloud/aliyun/elasticcache_acl.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package aliyun import ( diff --git a/pkg/multicloud/aliyun/elasticcache_backup.go b/pkg/multicloud/aliyun/elasticcache_backup.go index 6c81c73c29..e3a025af62 100644 --- a/pkg/multicloud/aliyun/elasticcache_backup.go +++ b/pkg/multicloud/aliyun/elasticcache_backup.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package aliyun import ( diff --git a/pkg/multicloud/aliyun/elasticcache_instance.go b/pkg/multicloud/aliyun/elasticcache_instance.go index b1a3973808..964d9bad9f 100644 --- a/pkg/multicloud/aliyun/elasticcache_instance.go +++ b/pkg/multicloud/aliyun/elasticcache_instance.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package aliyun import ( diff --git a/pkg/multicloud/aliyun/elasticcache_parameter.go b/pkg/multicloud/aliyun/elasticcache_parameter.go index 4f9de9e4d5..606095d0aa 100644 --- a/pkg/multicloud/aliyun/elasticcache_parameter.go +++ b/pkg/multicloud/aliyun/elasticcache_parameter.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package aliyun import ( diff --git a/pkg/multicloud/aliyun/shell/elasticcache.go b/pkg/multicloud/aliyun/shell/elasticcache.go index e00a5685a4..d1b26c8326 100644 --- a/pkg/multicloud/aliyun/shell/elasticcache.go +++ b/pkg/multicloud/aliyun/shell/elasticcache.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package shell import ( diff --git a/pkg/multicloud/aliyun/storage.go b/pkg/multicloud/aliyun/storage.go index d99a2597a7..b8cd089c6e 100644 --- a/pkg/multicloud/aliyun/storage.go +++ b/pkg/multicloud/aliyun/storage.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/multicloud/aliyun/utils.go b/pkg/multicloud/aliyun/utils.go index 713f01ecb3..c007c2d3f2 100644 --- a/pkg/multicloud/aliyun/utils.go +++ b/pkg/multicloud/aliyun/utils.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package aliyun import ( diff --git a/pkg/multicloud/bucket_base.go b/pkg/multicloud/bucket_base.go index cf0185b375..c7ed3a18a1 100644 --- a/pkg/multicloud/bucket_base.go +++ b/pkg/multicloud/bucket_base.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package multicloud import "yunion.io/x/jsonutils" diff --git a/pkg/multicloud/elasticcache_base.go b/pkg/multicloud/elasticcache_base.go index b052980013..5824d5010e 100644 --- a/pkg/multicloud/elasticcache_base.go +++ b/pkg/multicloud/elasticcache_base.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package multicloud type SElasticcacheBase struct { diff --git a/pkg/multicloud/huawei/client/modules/mod_elasticcache.go b/pkg/multicloud/huawei/client/modules/mod_elasticcache.go index fab9180270..a0f02adac4 100644 --- a/pkg/multicloud/huawei/client/modules/mod_elasticcache.go +++ b/pkg/multicloud/huawei/client/modules/mod_elasticcache.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package modules import ( diff --git a/pkg/multicloud/huawei/dbinstance.go b/pkg/multicloud/huawei/dbinstance.go index 4728a086d4..acbc093e11 100644 --- a/pkg/multicloud/huawei/dbinstance.go +++ b/pkg/multicloud/huawei/dbinstance.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package huawei import ( diff --git a/pkg/multicloud/huawei/dbinstance_account.go b/pkg/multicloud/huawei/dbinstance_account.go index e3be9b2ccc..b11db7aa93 100644 --- a/pkg/multicloud/huawei/dbinstance_account.go +++ b/pkg/multicloud/huawei/dbinstance_account.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package huawei import ( diff --git a/pkg/multicloud/huawei/dbinstance_backup.go b/pkg/multicloud/huawei/dbinstance_backup.go index c04619288a..93844aa1ba 100644 --- a/pkg/multicloud/huawei/dbinstance_backup.go +++ b/pkg/multicloud/huawei/dbinstance_backup.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package huawei import ( diff --git a/pkg/multicloud/huawei/dbinstance_database.go b/pkg/multicloud/huawei/dbinstance_database.go index ff15aef4da..f092b3555d 100644 --- a/pkg/multicloud/huawei/dbinstance_database.go +++ b/pkg/multicloud/huawei/dbinstance_database.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package huawei import ( diff --git a/pkg/multicloud/huawei/dbinstance_parameter.go b/pkg/multicloud/huawei/dbinstance_parameter.go index 81e8e68bf5..a426ea4a1c 100644 --- a/pkg/multicloud/huawei/dbinstance_parameter.go +++ b/pkg/multicloud/huawei/dbinstance_parameter.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package huawei type SDBInstanceParameter struct { diff --git a/pkg/multicloud/huawei/dbinstance_privilege.go b/pkg/multicloud/huawei/dbinstance_privilege.go index 7d2b7b002d..18fefa7dd8 100644 --- a/pkg/multicloud/huawei/dbinstance_privilege.go +++ b/pkg/multicloud/huawei/dbinstance_privilege.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package huawei import ( diff --git a/pkg/multicloud/huawei/elasticcache_account.go b/pkg/multicloud/huawei/elasticcache_account.go index 3824afff81..fd787ec85e 100644 --- a/pkg/multicloud/huawei/elasticcache_account.go +++ b/pkg/multicloud/huawei/elasticcache_account.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package huawei import ( diff --git a/pkg/multicloud/huawei/elasticcache_backup.go b/pkg/multicloud/huawei/elasticcache_backup.go index 1e58797345..e59712753a 100644 --- a/pkg/multicloud/huawei/elasticcache_backup.go +++ b/pkg/multicloud/huawei/elasticcache_backup.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package huawei import ( diff --git a/pkg/multicloud/huawei/elasticcache_instance.go b/pkg/multicloud/huawei/elasticcache_instance.go index 8f227e980f..79a286cf6a 100644 --- a/pkg/multicloud/huawei/elasticcache_instance.go +++ b/pkg/multicloud/huawei/elasticcache_instance.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package huawei import ( diff --git a/pkg/multicloud/huawei/elasticcache_parameter.go b/pkg/multicloud/huawei/elasticcache_parameter.go index a3d607c468..c84242eee2 100644 --- a/pkg/multicloud/huawei/elasticcache_parameter.go +++ b/pkg/multicloud/huawei/elasticcache_parameter.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package huawei import ( diff --git a/pkg/multicloud/huawei/shell/elasticcache.go b/pkg/multicloud/huawei/shell/elasticcache.go index 9908dee7f6..32805b8f57 100644 --- a/pkg/multicloud/huawei/shell/elasticcache.go +++ b/pkg/multicloud/huawei/shell/elasticcache.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package shell import ( diff --git a/pkg/multicloud/objectstore/shell/minio.go b/pkg/multicloud/objectstore/shell/minio.go index 2ab321824f..2b61697c59 100644 --- a/pkg/multicloud/objectstore/shell/minio.go +++ b/pkg/multicloud/objectstore/shell/minio.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package shell import ( diff --git a/pkg/util/fileutils2/seeker.go b/pkg/util/fileutils2/seeker.go index 5c3920884b..cff1ed7813 100644 --- a/pkg/util/fileutils2/seeker.go +++ b/pkg/util/fileutils2/seeker.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package fileutils2 import ( diff --git a/pkg/util/fileutils2/seeker_test.go b/pkg/util/fileutils2/seeker_test.go index 88f50694c8..4c6e211e70 100644 --- a/pkg/util/fileutils2/seeker_test.go +++ b/pkg/util/fileutils2/seeker_test.go @@ -1,3 +1,17 @@ +// Copyright 2019 Yunion +// +// 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 License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package fileutils2 import (