Skip to content

Commit b6b3197

Browse files
Merge branch 'master' into pubsub
2 parents 86a0758 + 8f28cb6 commit b6b3197

File tree

190 files changed

+1501
-443
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+1501
-443
lines changed

.kokoro/presubmit_tests_testing.cfg

Lines changed: 0 additions & 15 deletions
This file was deleted.

.kokoro/system_tests_testing.cfg

Lines changed: 0 additions & 15 deletions
This file was deleted.

appengine/flexible/analytics/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def track_event(category, action, label=None, value=0):
4242
}
4343

4444
response = requests.post(
45-
'http://www.google-analytics.com/collect', data=data)
45+
'https://www.google-analytics.com/collect', data=data)
4646

4747
# If the request fails, this will raise a RequestException. Depending
4848
# on your application's needs, this may be a non-error and can be caught
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Flask==1.0.2
22
gunicorn==19.9.0
3-
requests[security]==2.19.1
3+
requests[security]==2.20.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Flask==1.0.2
22
Flask-SQLAlchemy==2.3.2
33
gunicorn==19.9.0
4-
psycopg2==2.7.5
4+
psycopg2==2.7.6.1
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Flask==0.12.2
2-
google-cloud-datastore==1.6.0
3-
gunicorn==19.7.1
1+
Flask==1.0.2
2+
google-cloud-datastore==1.7.1
3+
gunicorn==19.9.0
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Django==2.1
1+
Django==2.1.3
22
mysqlclient==1.3.13
3-
wheel==0.31.1
3+
wheel==0.32.3
44
gunicorn==19.9.0
5-
psycopg2==2.7.5
5+
psycopg2==2.7.6.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Django==2.1
1+
Django==2.1.3
22
gunicorn==19.9.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Flask==1.0.2
22
gunicorn==19.9.0
3-
requests[security]==2.19.1
3+
requests[security]==2.20.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Flask==1.0.2
22
gunicorn==19.9.0
3-
requests[security]==2.19.1
3+
requests[security]==2.20.1
44
mailjet-rest==1.3.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Flask==1.0.2
22
gunicorn==19.9.0
3-
pylibmc==1.5.2
3+
pylibmc==1.6.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Flask==1.0.2
22
gunicorn==19.9.0
3-
requests[security]==2.19.1
3+
requests[security]==2.20.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Flask==1.0.2
22
gunicorn==19.9.0
3-
requests==2.19.1
3+
requests==2.20.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Flask==1.0.2
22
gunicorn==19.9.0
3-
requests==2.19.1
3+
requests==2.20.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Flask==1.0.2
22
gunicorn==19.9.0
3-
numpy==1.15.1
3+
numpy==1.15.4
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Flask==1.0.2
2-
google-cloud-pubsub==0.37.2
2+
google-cloud-pubsub==0.38.0
33
gunicorn==19.9.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Flask==1.0.2
22
gunicorn==19.9.0
3-
redis==2.10.6
3+
redis==3.0.1
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Flask==1.0.2
22
gunicorn==19.9.0
3-
numpy==1.15.1
3+
numpy==1.15.4
44
scipy==1.1.0
5-
Pillow==5.2.0
5+
Pillow==5.3.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Flask==1.0.2
2-
google-cloud-storage==1.10.0
2+
google-cloud-storage==1.13.0
33
gunicorn==19.9.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Flask==1.0.2
22
gunicorn==19.9.0
3-
twilio==6.16.3
3+
twilio==6.20.0

appengine/standard/analytics/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def track_event(category, action, label=None, value=0):
4545
}
4646

4747
response = requests.post(
48-
'http://www.google-analytics.com/collect', data=data)
48+
'https://www.google-analytics.com/collect', data=data)
4949

5050
# If the request fails, this will raise a RequestException. Depending
5151
# on your application's needs, this may be a non-error and can be caught
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Flask==1.0.2
2-
requests==2.19.1
2+
requests==2.20.1
33
requests-toolbelt==0.8.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-endpoints==4.5.0
2-
google-endpoints-api-management==1.9.1
1+
google-endpoints==4.7.0
2+
google-endpoints-api-management==1.11.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-endpoints==4.5.0
2-
google-endpoints-api-management==1.9.1
1+
google-endpoints==4.7.0
2+
google-endpoints-api-management==1.11.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-endpoints==4.5.0
2-
google-endpoints-api-management==1.9.1
1+
google-endpoints==4.7.0
2+
google-endpoints-api-management==1.11.0
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Flask==1.0.2
22
pyjwt==1.6.4
3-
flask-cors==3.0.6
4-
google-auth==1.5.1
5-
requests==2.19.1
3+
flask-cors==3.0.7
4+
google-auth==1.6.1
5+
requests==2.20.1
66
requests-toolbelt==0.8.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
flask==1.0.2
2-
requests==2.19.1
2+
requests==2.20.1
33
requests_toolbelt==0.8.0
4-
oauth2client==4.1.2
4+
oauth2client==4.1.3
55
functools32==3.2.3.post2; python_version < "3"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Flask==0.12.2
1+
Flask==1.0.2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
httplib2==0.11.3
1+
httplib2==0.12.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Flask==1.0.2
2-
requests==2.19.1
2+
requests==2.20.1
33
requests-toolbelt==0.8.0
44
mailjet-rest==1.3.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
google-api-python-client==1.7.4
2-
google-auth==1.5.1
2+
google-auth==1.6.1
33
google-auth-httplib2==0.0.3
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Flask==1.0.2
2-
requests==2.19.1
2+
requests==2.20.1
33
requests-toolbelt==0.8.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-cloud-bigquery==1.6.0
1+
google-cloud-bigquery==1.7.0
22
Flask==1.0.2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Flask==1.0.2
2-
google-cloud-datastore==1.7.0
2+
google-cloud-datastore==1.7.1
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Flask==1.0.2
2-
google-cloud-datastore==1.7.0
3-
google-auth==1.5.1
4-
requests==2.19.1
2+
google-cloud-datastore==1.7.1
3+
google-auth==1.6.1
4+
requests==2.20.1
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Flask==1.0.2
2-
google-cloud-datastore==1.7.0
3-
google-auth==1.5.1
4-
requests==2.19.1
2+
google-cloud-datastore==1.7.1
3+
google-auth==1.6.1
4+
requests==2.20.1
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
flask==1.0.2
2-
psycopg2==2.7.5
3-
psycopg2-binary==2.7.5
2+
psycopg2==2.7.6.1
3+
psycopg2-binary==2.7.6.1
44
PyMySQL==0.9.2
5-
SQLAlchemy==1.2.12
5+
SQLAlchemy==1.2.14
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Django==2.1.1
2-
PyMySQL==0.9.2
1+
Django==2.1.3
2+
PyMySQL==0.9.2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Flask==1.0.2
2-
redis==2.10.6
2+
redis==3.0.1
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-cloud-spanner==1.6.0
2-
Flask==1.0.2
1+
google-cloud-spanner==1.6.1
2+
Flask==1.0.2
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env python
2+
3+
# Copyright 2018 Google LLC.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
18+
import argparse
19+
20+
21+
def batch_get_assets_history(project_id, asset_names):
22+
# [START asset_quickstart_batch_get_assets_history]
23+
from google.cloud import asset_v1beta1
24+
from google.cloud.asset_v1beta1.proto import assets_pb2
25+
from google.cloud.asset_v1beta1 import enums
26+
27+
# TODO project_id = 'Your Google Cloud Project ID'
28+
# TODO asset_names = 'Your asset names list, e.g.:
29+
# ["//storage.googleapis.com/[BUCKET_NAME]",]'
30+
31+
client = asset_v1beta1.AssetServiceClient()
32+
parent = client.project_path(project_id)
33+
content_type = enums.ContentType.RESOURCE
34+
read_time_window = assets_pb2.TimeWindow()
35+
read_time_window.start_time.GetCurrentTime()
36+
response = client.batch_get_assets_history(
37+
parent, content_type, read_time_window, asset_names)
38+
print('assets: {}'.format(response.assets))
39+
# [END asset_quickstart_batch_get_assets_history]
40+
41+
42+
if __name__ == '__main__':
43+
parser = argparse.ArgumentParser(
44+
description=__doc__,
45+
formatter_class=argparse.RawDescriptionHelpFormatter
46+
)
47+
parser.add_argument('project_id', help='Your Google Cloud project ID')
48+
parser.add_argument(
49+
'asset_names',
50+
help='The asset names for which history will be fetched, comma '
51+
'delimited, e.g.: //storage.googleapis.com/[BUCKET_NAME]')
52+
53+
args = parser.parse_args()
54+
55+
asset_name_list = args.asset_names.split(',')
56+
57+
batch_get_assets_history(args.project_id, asset_name_list)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env python
2+
3+
# Copyright 2018 Google LLC.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
import os
18+
import time
19+
20+
from google.cloud import storage
21+
import pytest
22+
23+
import quickstart_batchgetassetshistory
24+
25+
PROJECT = os.environ['GCLOUD_PROJECT']
26+
BUCKET = 'assets-{}'.format(int(time.time()))
27+
28+
29+
@pytest.fixture(scope='module')
30+
def storage_client():
31+
yield storage.Client()
32+
33+
34+
@pytest.fixture(scope='module')
35+
def asset_bucket(storage_client):
36+
bucket = storage_client.create_bucket(BUCKET)
37+
38+
yield BUCKET
39+
40+
try:
41+
bucket.delete(force=True)
42+
except Exception as e:
43+
print('Failed to delete bucket{}'.format(BUCKET))
44+
raise e
45+
46+
47+
def test_batch_get_assets_history(asset_bucket, capsys):
48+
bucket_asset_name = '//storage.googleapis.com/{}'.format(BUCKET)
49+
asset_names = [bucket_asset_name, ]
50+
quickstart_batchgetassetshistory.batch_get_assets_history(
51+
PROJECT, asset_names)
52+
out, _ = capsys.readouterr()
53+
54+
if not out:
55+
assert bucket_asset_name in out

asset/cloud-client/quickstart_exportassets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
def export_assets(project_id, dump_file_path):
22-
# [START asset_quickstart_exportassets]
22+
# [START asset_quickstart_export_assets]
2323
from google.cloud import asset_v1beta1
2424
from google.cloud.asset_v1beta1.proto import asset_service_pb2
2525

@@ -32,7 +32,7 @@ def export_assets(project_id, dump_file_path):
3232
output_config.gcs_destination.uri = dump_file_path
3333
response = client.export_assets(parent, output_config)
3434
print(response.result())
35-
# [END asset_quickstart_exportassets]
35+
# [END asset_quickstart_export_assets]
3636

3737

3838
if __name__ == '__main__':

0 commit comments

Comments
 (0)