@@ -57,7 +57,7 @@ def delete_note(note_id, project_id):
57
57
58
58
client = containeranalysis_v1 .ContainerAnalysisClient ()
59
59
grafeas_client = client .get_grafeas_client ()
60
- note_name = grafeas_client . note_path ( project_id , note_id )
60
+ note_name = f"projects/ { project_id } /notes/ { note_id } "
61
61
62
62
grafeas_client .delete_note (note_name )
63
63
# [END containeranalysis_delete_note]
@@ -77,7 +77,7 @@ def create_occurrence(resource_url, note_id, occurrence_project, note_project):
77
77
78
78
client = containeranalysis_v1 .ContainerAnalysisClient ()
79
79
grafeas_client = client .get_grafeas_client ()
80
- formatted_note = grafeas_client . note_path ( note_project , note_id )
80
+ formatted_note = f"projects/ { note_project } /notes/ { note_id } "
81
81
formatted_project = grafeas_client .project_path (occurrence_project )
82
82
83
83
occurrence = {
@@ -113,7 +113,7 @@ def delete_occurrence(occurrence_id, project_id):
113
113
114
114
client = containeranalysis_v1 .ContainerAnalysisClient ()
115
115
grafeas_client = client .get_grafeas_client ()
116
- parent = grafeas_client . occurrence_path ( project_id , occurrence_id )
116
+ parent = f"projects/ { project_id } /occurrences/ { occurrence_id } "
117
117
grafeas_client .delete_occurrence (parent )
118
118
# [END containeranalysis_delete_occurrence]
119
119
@@ -128,7 +128,7 @@ def get_note(note_id, project_id):
128
128
129
129
client = containeranalysis_v1 .ContainerAnalysisClient ()
130
130
grafeas_client = client .get_grafeas_client ()
131
- note_name = grafeas_client . note_path ( project_id , note_id )
131
+ note_name = f"projects/ { project_id } /notes/ { note_id } "
132
132
response = grafeas_client .get_note (note_name )
133
133
return response
134
134
# [END containeranalysis_get_note]
@@ -144,7 +144,7 @@ def get_occurrence(occurrence_id, project_id):
144
144
145
145
client = containeranalysis_v1 .ContainerAnalysisClient ()
146
146
grafeas_client = client .get_grafeas_client ()
147
- parent = grafeas_client . occurrence_path ( project_id , occurrence_id )
147
+ parent = f"projects/ { project_id } /occurrences/ { occurrence_id } "
148
148
return grafeas_client .get_occurrence (parent )
149
149
# [END containeranalysis_get_occurrence]
150
150
@@ -181,7 +181,7 @@ def get_occurrences_for_note(note_id, project_id):
181
181
182
182
client = containeranalysis_v1 .ContainerAnalysisClient ()
183
183
grafeas_client = client .get_grafeas_client ()
184
- note_name = grafeas_client . note_path ( project_id , note_id )
184
+ note_name = f"projects/ { project_id } /notes/ { note_id } "
185
185
186
186
response = grafeas_client .list_note_occurrences (note_name )
187
187
count = 0
0 commit comments