Skip to content

Commit

Permalink
chore: add api_endpoint_comment (#138)
Browse files Browse the repository at this point in the history
* chore: add api_endpoint_comment
  • Loading branch information
dizcology committed Dec 16, 2020
1 parent 53cdbab commit dd8677c
Show file tree
Hide file tree
Showing 104 changed files with 116 additions and 20 deletions.
Expand Up @@ -20,7 +20,7 @@ def make_parent(parent: str) -> str:

def make_batch_prediction_job(
display_name: str,
model: str,
model_name: str,
gcs_source_uri: str,
gcs_destination_output_uri_prefix: str,
) -> google.cloud.aiplatform_v1beta1.types.batch_prediction_job.BatchPredictionJob:
Expand All @@ -30,7 +30,7 @@ def make_batch_prediction_job(
batch_prediction_job = {
"display_name": display_name,
# Format: 'projects/{project}/locations/{location}/models/{model_id}'
"model": model,
"model": model_name,
"model_parameters": model_parameters,
"input_config": {
"instances_format": "jsonl",
Expand Down
Expand Up @@ -20,7 +20,7 @@ def make_parent(parent: str) -> str:

def make_batch_prediction_job(
display_name: str,
model: str,
model_name: str,
gcs_source_uri: str,
gcs_destination_output_uri_prefix: str,
) -> google.cloud.aiplatform_v1beta1.types.batch_prediction_job.BatchPredictionJob:
Expand All @@ -30,7 +30,7 @@ def make_batch_prediction_job(
batch_prediction_job = {
"display_name": display_name,
# Format: 'projects/{project}/locations/{location}/models/{model_id}'
"model": model,
"model": model_name,
"model_parameters": model_parameters,
"input_config": {
"instances_format": "jsonl",
Expand Down
Expand Up @@ -20,7 +20,7 @@ def make_parent(parent: str) -> str:

def make_batch_prediction_job(
display_name: str,
model: str,
model_name: str,
gcs_source_uri: str,
gcs_destination_output_uri_prefix: str,
) -> google.cloud.aiplatform_v1beta1.types.batch_prediction_job.BatchPredictionJob:
Expand All @@ -30,7 +30,7 @@ def make_batch_prediction_job(
batch_prediction_job = {
"display_name": display_name,
# Format: 'projects/{project}/locations/{location}/models/{model_id}'
"model": model,
"model": model_name,
"model_parameters": model_parameters,
"input_config": {
"instances_format": "jsonl",
Expand Down
Expand Up @@ -22,7 +22,7 @@ def make_parent(parent: str) -> str:

def make_batch_prediction_job(
display_name: str,
model: str,
model_name: str,
gcs_source_uri: str,
gcs_destination_output_uri_prefix: str,
) -> google.cloud.aiplatform_v1beta1.types.batch_prediction_job.BatchPredictionJob:
Expand All @@ -34,7 +34,7 @@ def make_batch_prediction_job(
batch_prediction_job = {
"display_name": display_name,
# Format: 'projects/{project}/locations/{location}/models/{model_id}'
"model": model,
"model": model_name,
"model_parameters": model_parameters,
"input_config": {
"instances_format": "jsonl",
Expand Down
1 change: 1 addition & 0 deletions .sample_configs/process_configs.yaml
@@ -1,5 +1,6 @@
global:
api_endpoint: us-central1-aiplatform.googleapis.com
api_endpoint_comment: The AI Platform services require regional API endpoints.
timeout: 300
skip:
- etag
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/cancel_batch_prediction_job_sample.py
Expand Up @@ -22,6 +22,7 @@ def cancel_batch_prediction_job_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/cancel_custom_job_sample.py
Expand Up @@ -22,6 +22,7 @@ def cancel_custom_job_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/cancel_data_labeling_job_sample.py
Expand Up @@ -22,6 +22,7 @@ def cancel_data_labeling_job_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
Expand Up @@ -22,6 +22,7 @@ def cancel_hyperparameter_tuning_job_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/cancel_training_pipeline_sample.py
Expand Up @@ -22,6 +22,7 @@ def cancel_training_pipeline_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
Expand Up @@ -29,6 +29,7 @@ def create_batch_prediction_job_bigquery_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/create_batch_prediction_job_sample.py
Expand Up @@ -29,6 +29,7 @@ def create_batch_prediction_job_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
Expand Up @@ -21,12 +21,13 @@
def create_batch_prediction_job_text_classification_sample(
project: str,
display_name: str,
model: str,
model_name: str,
gcs_source_uri: str,
gcs_destination_output_uri_prefix: str,
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand All @@ -37,7 +38,7 @@ def create_batch_prediction_job_text_classification_sample(
batch_prediction_job = {
"display_name": display_name,
# Format: 'projects/{project}/locations/{location}/models/{model_id}'
"model": model,
"model": model_name,
"model_parameters": model_parameters,
"input_config": {
"instances_format": "jsonl",
Expand Down
Expand Up @@ -43,7 +43,7 @@ def test_ucaip_generated_create_batch_prediction_tcn_sample(capsys, shared_state
create_batch_prediction_job_text_classification_sample.create_batch_prediction_job_text_classification_sample(
project=PROJECT_ID,
display_name=DISPLAY_NAME,
model=model_name,
model_name=model_name,
gcs_source_uri=GCS_SOURCE_URI,
gcs_destination_output_uri_prefix=GCS_OUTPUT_URI,
)
Expand Down
Expand Up @@ -21,12 +21,13 @@
def create_batch_prediction_job_text_entity_extraction_sample(
project: str,
display_name: str,
model: str,
model_name: str,
gcs_source_uri: str,
gcs_destination_output_uri_prefix: str,
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand All @@ -37,7 +38,7 @@ def create_batch_prediction_job_text_entity_extraction_sample(
batch_prediction_job = {
"display_name": display_name,
# Format: 'projects/{project}/locations/{location}/models/{model_id}'
"model": model,
"model": model_name,
"model_parameters": model_parameters,
"input_config": {
"instances_format": "jsonl",
Expand Down
Expand Up @@ -43,7 +43,7 @@ def test_ucaip_generated_create_batch_prediction_ten_sample(capsys, shared_state
create_batch_prediction_job_text_entity_extraction_sample.create_batch_prediction_job_text_entity_extraction_sample(
project=PROJECT_ID,
display_name=DISPLAY_NAME,
model=model_name,
model_name=model_name,
gcs_source_uri=GCS_SOURCE_URI,
gcs_destination_output_uri_prefix=GCS_OUTPUT_URI,
)
Expand Down
Expand Up @@ -21,12 +21,13 @@
def create_batch_prediction_job_text_sentiment_analysis_sample(
project: str,
display_name: str,
model: str,
model_name: str,
gcs_source_uri: str,
gcs_destination_output_uri_prefix: str,
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand All @@ -37,7 +38,7 @@ def create_batch_prediction_job_text_sentiment_analysis_sample(
batch_prediction_job = {
"display_name": display_name,
# Format: 'projects/{project}/locations/{location}/models/{model_id}'
"model": model,
"model": model_name,
"model_parameters": model_parameters,
"input_config": {
"instances_format": "jsonl",
Expand Down
Expand Up @@ -43,7 +43,7 @@ def test_ucaip_generated_create_batch_prediction_tsn_sample(capsys, shared_state
create_batch_prediction_job_text_sentiment_analysis_sample.create_batch_prediction_job_text_sentiment_analysis_sample(
project=PROJECT_ID,
display_name=DISPLAY_NAME,
model=model_name,
model_name=model_name,
gcs_source_uri=GCS_SOURCE_URI,
gcs_destination_output_uri_prefix=GCS_OUTPUT_URI,
)
Expand Down
Expand Up @@ -21,12 +21,13 @@
def create_batch_prediction_job_video_action_recognition_sample(
project: str,
display_name: str,
model: str,
model_name: str,
gcs_source_uri: str,
gcs_destination_output_uri_prefix: str,
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand All @@ -39,7 +40,7 @@ def create_batch_prediction_job_video_action_recognition_sample(
batch_prediction_job = {
"display_name": display_name,
# Format: 'projects/{project}/locations/{location}/models/{model_id}'
"model": model,
"model": model_name,
"model_parameters": model_parameters,
"input_config": {
"instances_format": "jsonl",
Expand Down
Expand Up @@ -45,7 +45,7 @@ def test_create_batch_prediction_job_video_action_recognition_sample(
create_batch_prediction_job_video_action_recognition_sample.create_batch_prediction_job_video_action_recognition_sample(
project=PROJECT_ID,
display_name=DISPLAY_NAME,
model=model_name,
model_name=model_name,
gcs_source_uri=GCS_SOURCE_URI,
gcs_destination_output_uri_prefix=GCS_OUTPUT_URI,
)
Expand Down
Expand Up @@ -27,6 +27,7 @@ def create_batch_prediction_job_video_classification_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
Expand Up @@ -27,6 +27,7 @@ def create_batch_prediction_job_video_object_tracking_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/create_custom_job_sample.py
Expand Up @@ -23,6 +23,7 @@ def create_custom_job_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
Expand Up @@ -28,6 +28,7 @@ def create_data_labeling_job_active_learning_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
Expand Up @@ -29,6 +29,7 @@ def create_data_labeling_job_image_segmentation_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/create_data_labeling_job_images_sample.py
Expand Up @@ -27,6 +27,7 @@ def create_data_labeling_job_images_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/create_data_labeling_job_sample.py
Expand Up @@ -28,6 +28,7 @@ def create_data_labeling_job_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
Expand Up @@ -29,6 +29,7 @@ def create_data_labeling_job_specialist_pool_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/create_data_labeling_job_video_sample.py
Expand Up @@ -27,6 +27,7 @@ def create_data_labeling_job_video_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/create_dataset_image_sample.py
Expand Up @@ -23,6 +23,7 @@ def create_dataset_image_sample(
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
timeout: int = 300,
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/create_dataset_sample.py
Expand Up @@ -24,6 +24,7 @@ def create_dataset_sample(
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
timeout: int = 300,
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/create_dataset_tabular_bigquery_sample.py
Expand Up @@ -26,6 +26,7 @@ def create_dataset_tabular_bigquery_sample(
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
timeout: int = 300,
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/create_dataset_tabular_gcs_sample.py
Expand Up @@ -26,6 +26,7 @@ def create_dataset_tabular_gcs_sample(
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
timeout: int = 300,
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/create_dataset_text_sample.py
Expand Up @@ -23,6 +23,7 @@ def create_dataset_text_sample(
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
timeout: int = 300,
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/create_dataset_video_sample.py
Expand Up @@ -23,6 +23,7 @@ def create_dataset_video_sample(
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
timeout: int = 300,
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
1 change: 1 addition & 0 deletions samples/snippets/create_endpoint_sample.py
Expand Up @@ -23,6 +23,7 @@ def create_endpoint_sample(
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
timeout: int = 300,
):
# The AI Platform services require regional API endpoints.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down

0 comments on commit dd8677c

Please sign in to comment.