Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Unified Diff: tools/telemetry/third_party/gsutil/gslib/cs_api_map.py

Issue 1260493004: Revert "Add gsutil 4.13 to telemetry/third_party" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/third_party/gsutil/gslib/cs_api_map.py
diff --git a/tools/telemetry/third_party/gsutil/gslib/cs_api_map.py b/tools/telemetry/third_party/gsutil/gslib/cs_api_map.py
deleted file mode 100644
index 24d28014a2d6f3aa02a987297792483c561e2558..0000000000000000000000000000000000000000
--- a/tools/telemetry/third_party/gsutil/gslib/cs_api_map.py
+++ /dev/null
@@ -1,103 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright 2013 Google Inc. All Rights Reserved.
-#
-# 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.
-"""API map classes used with the CloudApiDelegator class."""
-
-from __future__ import absolute_import
-
-from gslib.boto_translation import BotoTranslation
-from gslib.gcs_json_api import GcsJsonApi
-
-
-class ApiSelector(object):
- """Enum class for API."""
- XML = 'XML'
- JSON = 'JSON'
-
-
-class ApiMapConstants(object):
- """Enum class for API map entries."""
- API_MAP = 'apiclass'
- SUPPORT_MAP = 'supported'
- DEFAULT_MAP = 'default'
-
-
-class GsutilApiClassMapFactory(object):
- """Factory for generating gsutil API class maps.
-
- A valid class map is defined as:
- {
- (key) Provider prefix used in URI strings.
- (value) {
- (key) ApiSelector describing the API format.
- (value) CloudApi child class that implements this API.
- }
- }
- """
-
- @classmethod
- def GetClassMap(cls):
- """Returns the default gsutil class map."""
- gs_class_map = {
- ApiSelector.XML: BotoTranslation,
- ApiSelector.JSON: GcsJsonApi
- }
- s3_class_map = {
- ApiSelector.XML: BotoTranslation
- }
- class_map = {
- 'gs': gs_class_map,
- 's3': s3_class_map
- }
- return class_map
-
-
-class GsutilApiMapFactory(object):
- """Factory the generates the default gsutil API map.
-
- The API map determines which Cloud API implementation is used for a given
- command. A valid API map is defined as:
- {
- (key) ApiMapConstants.API_MAP : (value) Gsutil API class map (as
- described in GsutilApiClassMapFactory comments).
- (key) ApiMapConstants.SUPPORT_MAP : (value) {
- (key) Provider prefix used in URI strings.
- (value) list of ApiSelectors supported by the command for this provider.
- }
- (key) ApiMapConstants.DEFAULT_MAP : (value) {
- (key) Provider prefix used in URI strings.
- (value) Default ApiSelector for this command and provider.
- }
- }
- """
-
- @classmethod
- def GetApiMap(cls, gsutil_api_class_map_factory, support_map, default_map):
- """Creates a GsutilApiMap for use by the command from the inputs.
-
- Args:
- gsutil_api_class_map_factory: Factory defining a GetClassMap() function
- adhering to GsutilApiClassMapFactory
- semantics.
- support_map: Entries for ApiMapConstants.SUPPORT_MAP as described above.
- default_map: Entries for ApiMapConstants.DEFAULT_MAP as described above.
-
- Returns:
- GsutilApiMap generated from the inputs.
- """
- return {
- ApiMapConstants.API_MAP: gsutil_api_class_map_factory.GetClassMap(),
- ApiMapConstants.SUPPORT_MAP: support_map,
- ApiMapConstants.DEFAULT_MAP: default_map
- }

Powered by Google App Engine
This is Rietveld 408576698