כדי לשלוח מסמכים לעיבוד, קודם צריך ליצור מכונה משלכם של מעבד. בדף הזה מוסבר איך ליצור ולנהל מעבדים.
מעבדים זמינים
כדי ליצור מופע של מעבד באמצעות API, אתם צריכים לדעת את השם של כל סוג מעבד. כדאי לקבל את הרשימה הזו באופן דינמי (באמצעות הקוד שבהמשך), כי הגישה שלכם עשויה להשתנות.
סוגי המעבדים שזמינים לכולם הם:
מעבדי דיגיטציה
OCR_PROCESSORFORM_PARSER_PROCESSORLAYOUT_PARSER_PROCESSOR
מעבדים שעברו אימון
BANK_STATEMENT_PROCESSOREXPENSE_PROCESSORFORM_W2_PROCESSORID_PROOFING_PROCESSORINVOICE_PROCESSORPAYSTUB_PROCESSORUS_DRIVER_LICENSE_PROCESSORUS_PASSPORT_PROCESSORUTILITY_PROCESSOR
מעבדי חילוץ / סיווג / פיצול
CUSTOM_EXTRACTION_PROCESSORCUSTOM_CLASSIFICATION_PROCESSORCUSTOM_SPLITTING_PROCESSORSUMMARIZER_PROCESSOR
הצגת רשימה של סוגי מעבדים
ממשק המשתמש באינטרנט
במסוף Google Cloud , בקטע Document AI, נכנסים לדף Processor Gallery.
צפייה ברשימה של סוגי המעבדים או חיפוש ברשימה.
REST
בדוגמה הזו מוסבר איך להציג את רשימת סוגי המעבדים שזמינים לפרויקט באמצעות השיטה fetchProcessorTypes.
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
- LOCATION: המיקום של המעבד, לדוגמה:
us– ארצות הבריתeu– האיחוד האירופי
- PROJECT_ID: מזהה הפרויקט ב- Google Cloud .
ה-method של ה-HTTP וכתובת ה-URL:
GET https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION:fetchProcessorTypes
כדי לשלוח את הבקשה אתם צריכים לבחור אחת מהאפשרויות הבאות:
curl
מריצים את הפקודה הבאה:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION:fetchProcessorTypes"
PowerShell
מריצים את הפקודה הבאה:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION:fetchProcessorTypes" | Select-Object -Expand Content
התשובה היא רשימה של ProcessorType שמציגה את סוגי המעבדים הזמינים, יחד עם הקטגוריה והמיקומים הזמינים.
{
"processorTypes": [
[
...
{
"name": "projects/PROJECT_ID/locations/LOCATION/processorTypes/FORM_PARSER_PROCESSOR",
"type": "FORM_PARSER_PROCESSOR",
"category": "GENERAL",
"availableLocations": [
{
"locationId": "eu"
},
{
"locationId": "us"
}
],
"allowCreation": true,
"launchStage": "GA"
},
{
"name": "projects/PROJECT_ID/locations/LOCATION/processorTypes/OCR_PROCESSOR",
"type": "OCR_PROCESSOR",
"category": "GENERAL",
"availableLocations": [
{
"locationId": "eu"
},
{
"locationId": "us"
}
],
"allowCreation": true,
"launchStage": "GA"
},
{
"name": "projects/PROJECT_ID/locations/LOCATION/processorTypes/INVOICE_PROCESSOR",
"type": "INVOICE_PROCESSOR",
"category": "SPECIALIZED",
"availableLocations": [
{
"locationId": "eu"
},
{
"locationId": "us"
}
],
"allowCreation": true,
"launchStage": "GA"
},
{
"name": "projects/PROJECT_ID/locations/LOCATION/processorTypes/US_DRIVER_LICENSE_PROCESSOR",
"type": "US_DRIVER_LICENSE_PROCESSOR",
"category": "SPECIALIZED",
"availableLocations": [
{
"locationId": "us"
},
{
"locationId": "eu"
}
],
"allowCreation": true,
"launchStage": "GA"
},
...
]
}
Python
מידע נוסף מופיע במאמרי העזרה של Document AI Python API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Go
מידע נוסף מופיע במאמרי העזרה של Document AI Go API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Java
מידע נוסף מופיע במאמרי העזרה של Document AI Java API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Ruby
מידע נוסף מופיע במאמרי העזרה של Document AI Ruby API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
C#
מידע נוסף מופיע במאמרי העזרה של Document AI C# API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
יצירת מעבד (processor)
ממשק המשתמש באינטרנט
במסוף Google Cloud , בקטע Document AI, נכנסים לדף Processor Gallery.
מחפשים בגלריית המעבדים את המעבד שרוצים ליצור.
לוחצים על סוג המעבד שרוצים ליצור מהרשימה.
בחלון הצדדי Create processor, מציינים שם למעבד.
בוחרים את האזור מהרשימה.
לוחצים על Create כדי ליצור את המעבד.
תועברו לכרטיסייה Overview של המעבד, שכוללת מידע כמו Name, ID, Type ו-Prediction endpoint. משתמשים בנקודת הקצה הזו כדי לשלוח בקשות.
REST
בדוגמה הזו מוסבר איך ליצור processor חדש באמצעות השיטה processors.create.
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
- LOCATION: המיקום של המעבד, לדוגמה:
us– ארצות הבריתeu– האיחוד האירופי
- PROJECT_ID: מזהה הפרויקט ב- Google Cloud .
- PROCESSOR_TYPE: סוג המעבד, לדוגמה:
OCR_PROCESSORFORM_PARSER_PROCESSORINVOICE_PROCESSORUS_DRIVER_LICENSE_PROCESSOR
- DISPLAY_NAME: השם המוצג של המעבד.
ה-method של ה-HTTP וכתובת ה-URL:
POST https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors
גוף בקשת JSON:
{
"type": "PROCESSOR_TYPE",
"displayName": "DISPLAY_NAME"
}
כדי לשלוח את הבקשה עליכם לבחור אחת מהאפשרויות הבאות:
curl
שומרים את גוף הבקשה בקובץ בשם request.json ומריצים את הפקודה הבאה:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors"
PowerShell
שומרים את גוף הבקשה בקובץ בשם request.json ומריצים את הפקודה הבאה:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors" | Select-Object -Expand Content
אם הבקשה תתבצע בהצלחה, השרת יחזיר קוד סטטוס 200 OK של HTTP ואת התשובה בפורמט JSON. התגובה מכילה מידע על המעבד החדש שנוצר, כמו processEndpoint והשם המלא של המעבד.
שתי המחרוזות האלה מכילות את מזהה המעבד הייחודי (למשל aa22ec60216f6ccc) שנדרש כדי לשלוח בקשות.
{
"name": "projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID",
"type": "PROCESSOR_TYPE",
"displayName": "DISPLAY_NAME",
"state": "ENABLED",
"processEndpoint": "https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID:process",
"createTime": "2022-03-02T22:50:31.395849Z",
"defaultProcessorVersion": "projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID/processorVersions/pretrained"
}
Python
מידע נוסף מופיע במאמרי העזרה של Document AI Python API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Go
מידע נוסף מופיע במאמרי העזרה של Document AI Go API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Java
מידע נוסף מופיע במאמרי העזרה של Document AI Java API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Ruby
מידע נוסף מופיע במאמרי העזרה של Document AI Ruby API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
C#
מידע נוסף מופיע במאמרי העזרה של Document AI C# API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
קבלת רשימה של מעבדי תשלומים
ממשק המשתמש באינטרנט
במסוף Google Cloud , בקטע Document AI, נכנסים לדף Processors.
בדף Processors מופיעה רשימה של כל המעבדים, כולל Name, Status, Region ו-Type.
REST
הדוגמה הזו מראה איך להציג רשימה של processors קיימים באמצעות השיטה processors.list.
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
- LOCATION: המיקום של המעבד, לדוגמה:
us– ארצות הבריתeu– האיחוד האירופי
- PROJECT_ID: מזהה הפרויקט ב- Google Cloud .
ה-method של ה-HTTP וכתובת ה-URL:
GET https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors
כדי לשלוח את הבקשה אתם צריכים לבחור אחת מהאפשרויות הבאות:
curl
מריצים את הפקודה הבאה:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors"
PowerShell
מריצים את הפקודה הבאה:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors" | Select-Object -Expand Content
התשובה היא רשימה של Processors, שמכילה מידע על כל מעבד, כמו name, type, state ופרטים נוספים.
{
"processors": [
{
"name": "projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID",
"type": "FORM_PARSER_PROCESSOR",
"displayName": "DISPLAY_NAME",
"state": "ENABLED",
"processEndpoint": "https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID:process",
"createTime": "2022-03-02T22:33:54.938593Z",
"defaultProcessorVersion": "projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID/processorVersions/pretrained"
}
]
}
Python
מידע נוסף מופיע במאמרי העזרה של Document AI Python API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Go
מידע נוסף מופיע במאמרי העזרה של Document AI Go API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Java
מידע נוסף מופיע במאמרי העזרה של Document AI Java API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Ruby
מידע נוסף מופיע במאמרי העזרה של Document AI Ruby API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
C#
מידע נוסף מופיע במאמרי העזרה של Document AI C# API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
הצגת פרטים על מעבד
ממשק המשתמש באינטרנט
במסוף Google Cloud , בקטע Document AI, נכנסים לדף Processors.
ברשימת המעבדים, לוחצים על שם המעבד שרוצים לראות את הפרטים שלו.
תועברו לכרטיסייה Overview של המעבד, שכוללת מידע כמו Name, ID, Type ו-Prediction endpoint.
REST
הדוגמה הזו מראה איך לקבל פרטים על Processor קיים באמצעות השיטה processors.get.
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
- LOCATION: המיקום של המעבד, לדוגמה:
us– ארצות הבריתeu– האיחוד האירופי
- PROJECT_ID: מזהה הפרויקט ב- Google Cloud .
- PROCESSOR_ID: המזהה של מודל העיבוד המותאם אישית.
ה-method של ה-HTTP וכתובת ה-URL:
GET https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID
כדי לשלוח את הבקשה אתם צריכים לבחור אחת מהאפשרויות הבאות:
curl
מריצים את הפקודה הבאה:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID"
PowerShell
מריצים את הפקודה הבאה:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID" | Select-Object -Expand Content
התשובה היא Processor, שמכילה מידע על המעבד, כמו name, type, state ופרטים נוספים.
{
"processors": [
{
"name": "projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID",
"type": "OCR_PROCESSOR",
"displayName": "DISPLAY_NAME",
"state": "ENABLED",
"processEndpoint": "https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID:process",
"createTime": "2022-03-02T22:33:54.938593Z",
"defaultProcessorVersion": "projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID/processorVersions/pretrained"
}
]
}
Python
מידע נוסף מופיע במאמרי העזרה של Document AI Python API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Go
מידע נוסף מופיע במאמרי העזרה של Document AI Go API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Java
מידע נוסף מופיע במאמרי העזרה של Document AI Java API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Ruby
מידע נוסף מופיע במאמרי העזרה של Document AI Ruby API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
C#
מידע נוסף מופיע במאמרי העזרה של Document AI C# API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
הפעלת מעבד
ממשק המשתמש באינטרנט
במסוף Google Cloud , בקטע Document AI, נכנסים לדף Processors.
ליד המעבד, בתפריט הפעולות , לוחצים על Enable processor.
REST
בדוגמה הזו מוסבר איך להפעיל Processor קיים באמצעות השיטה processors.enable.
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
- LOCATION: המיקום של המעבד, לדוגמה:
us– ארצות הבריתeu– האיחוד האירופי
- PROJECT_ID: מזהה הפרויקט ב- Google Cloud .
- PROCESSOR_ID: המזהה של מודל העיבוד המותאם אישית.
ה-method של ה-HTTP וכתובת ה-URL:
POST https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID:enable
כדי לשלוח את הבקשה אתם צריכים לבחור אחת מהאפשרויות הבאות:
curl
מריצים את הפקודה הבאה:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d "" \
"https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID:enable"
PowerShell
מריצים את הפקודה הבאה:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-Uri "https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID:enable" | Select-Object -Expand Content
התגובה היא פעולה ממושכת.
{
"name": "projects/PROJECT_ID/locations/LOCATION/operations/OPERATION",
"metadata": {
"@type": "type.googleapis.com/google.cloud.documentai.v1.EnableProcessorMetadata",
"commonMetadata": {
"state": "RUNNING",
"createTime": "2022-03-02T22:52:49.957096Z",
"updateTime": "2022-03-02T22:52:50.175976Z",
"resource": "projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID"
}
}
}
כדי לדגום את הפעולה הממושכת, מפעילים את operations.get:
curl -X GET /_p/documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/operations/OPERATION \ -H "Authorization: Bearer "$(gcloud auth print-access-token) \ -H "X-Goog-User-Project: PROJECT_ID"השדה
EnableProcessorMetadataבתגובה מציין את מצב הפעולה:{ "name": "projects/<project_id>/locations/<location>/operations/<operation>", "metadata": { "@type": "type.googleapis.com/google.cloud.documentai.v1.EnableProcessorMetadata", "commonMetadata": { "state": "SUCCEEDED", "createTime": "2022-03-02T22:52:49.957096Z", "updateTime": "2022-03-02T22:52:50.175976Z", "resource": "projects/<project_id>/locations/<location>/processors/<processor_id>" } }, "done": true, "response": { "@type": "type.googleapis.com/google.cloud.documentai.v1.EnableProcessorResponse" } }
Python
מידע נוסף מופיע במאמרי העזרה של Document AI Python API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Go
מידע נוסף מופיע במאמרי העזרה של Document AI Go API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Java
מידע נוסף מופיע במאמרי העזרה של Document AI Java API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Ruby
מידע נוסף מופיע במאמרי העזרה של Document AI Ruby API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
C#
מידע נוסף מופיע במאמרי העזרה של Document AI C# API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
השבתת מעבד
ממשק המשתמש באינטרנט
במסוף Google Cloud , בקטע Document AI, נכנסים לדף Processors.
- ליד המעבד, בתפריט הפעולות , לוחצים על Disable processor.
REST
הדוגמה הזו ממחישה איך להשבית Processor קיים באמצעות השיטה processors.disable.
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
- LOCATION: המיקום של המעבד, לדוגמה:
us– ארצות הבריתeu– האיחוד האירופי
- PROJECT_ID: מזהה הפרויקט ב- Google Cloud .
- PROCESSOR_ID: המזהה של מודל העיבוד המותאם אישית.
ה-method של ה-HTTP וכתובת ה-URL:
POST https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID:disable
כדי לשלוח את הבקשה אתם צריכים לבחור אחת מהאפשרויות הבאות:
curl
מריצים את הפקודה הבאה:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d "" \
"https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID:disable"
PowerShell
מריצים את הפקודה הבאה:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-Uri "https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID:disable" | Select-Object -Expand Content
התגובה היא פעולה ממושכת.
{
"name": "projects/PROJECT_ID/locations/LOCATION/operations/OPERATION",
"metadata": {
"@type": "type.googleapis.com/google.cloud.documentai.v1.DisableProcessorMetadata",
"commonMetadata": {
"state": "RUNNING",
"createTime": "2022-03-02T22:52:49.957096Z",
"updateTime": "2022-03-02T22:52:50.175976Z",
"resource": "projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID"
}
}
}
כדי לדגום את הפעולה הממושכת, מפעילים את operations.get:
curl -X GET /_p/documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/operations/OPERATION \ -H "Authorization: Bearer "$(gcloud auth print-access-token) \ -H "X-Goog-User-Project: PROJECT_ID"השדה
DisableProcessorMetadataבתגובה מציין את מצב הפעולה:{ "name": "projects/<project_id>/locations/<location>/operations/<operation>", "metadata": { "@type": "type.googleapis.com/google.cloud.documentai.v1.DisableProcessorMetadata", "commonMetadata": { "state": "SUCCEEDED", "createTime": "2022-03-02T22:52:49.957096Z", "updateTime": "2022-03-02T22:52:50.175976Z", "resource": "projects/<project_id>/locations/<location>/processors/<processor_id>" } }, "done": true, "response": { "@type": "type.googleapis.com/google.cloud.documentai.v1.DisableProcessorResponse" } }
Python
מידע נוסף מופיע במאמרי העזרה של Document AI Python API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Go
מידע נוסף מופיע במאמרי העזרה של Document AI Go API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Java
מידע נוסף מופיע במאמרי העזרה של Document AI Java API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Ruby
מידע נוסף מופיע במאמרי העזרה של Document AI Ruby API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
C#
מידע נוסף מופיע במאמרי העזרה של Document AI C# API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
מחיקת מעבד
ממשק המשתמש באינטרנט
במסוף Google Cloud , בקטע Document AI, נכנסים לדף Processors.
- בתפריט הפעולות ליד המעבד, לוחצים על Delete processor.
REST
הדוגמה הזו מראה איך למחוק Processor קיים באמצעות ה-method processors.delete.
לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:
- LOCATION: המיקום של המעבד, לדוגמה:
us– ארצות הבריתeu– האיחוד האירופי
- PROJECT_ID: מזהה הפרויקט ב- Google Cloud .
- PROCESSOR_ID: המזהה של מודל העיבוד המותאם אישית.
ה-method של ה-HTTP וכתובת ה-URL:
DELETE https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID
כדי לשלוח את הבקשה אתם צריכים לבחור אחת מהאפשרויות הבאות:
curl
מריצים את הפקודה הבאה:
curl -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID"
PowerShell
מריצים את הפקודה הבאה:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method DELETE `
-Headers $headers `
-Uri "https://LOCATION-documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID" | Select-Object -Expand Content
התגובה היא פעולה ממושכת
{
"name": "projects/PROJECT_ID/locations/LOCATION/operations/OPERATION",
"metadata": {
"@type": "type.googleapis.com/google.cloud.documentai.v1.DeleteProcessorMetadata",
"commonMetadata": {
"state": "RUNNING",
"createTime": "2022-03-02T22:52:49.957096Z",
"updateTime": "2022-03-02T22:52:50.175976Z",
"resource": "projects/PROJECT_ID/locations/LOCATION/processors/PROCESSOR_ID"
}
}
}
כדי לדגום את הפעולה הממושכת, מפעילים את operations.get:
curl -X GET /_p/documentai.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/operations/OPERATION \ -H "Authorization: Bearer "$(gcloud auth print-access-token) \ -H "X-Goog-User-Project: PROJECT_ID"השדה
DeleteProcessorMetadataבתגובה מציין את מצב הפעולה:{ "name": "projects/<project_id>/locations/<location>/operations/<operation>", "metadata": { "@type": "type.googleapis.com/google.cloud.documentai.v1.DeleteProcessorMetadata", "commonMetadata": { "state": "SUCCEEDED", "createTime": "2022-03-02T22:52:49.957096Z", "updateTime": "2022-03-02T22:52:50.175976Z", "resource": "projects/<project_id>/locations/<location>/processors/<processor_id>" } }, "done": true, "response": { "@type": "type.googleapis.com/google.protobuf.Empty" } }
Python
מידע נוסף מופיע במאמרי העזרה של Document AI Python API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Go
מידע נוסף מופיע במאמרי העזרה של Document AI Go API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Java
מידע נוסף מופיע במאמרי העזרה של Document AI Java API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
Ruby
מידע נוסף מופיע במאמרי העזרה של Document AI Ruby API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
C#
מידע נוסף מופיע במאמרי העזרה של Document AI C# API.
כדי לבצע אימות ב-Document AI, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.