एक्ज़ीक्यूट करें
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
/osc/commands/execute
एपीआई, कैमरे पर तय किए गए निर्देशों को लागू करता है. आउटपुट एक कमांड ऑब्जेक्ट है.
नाम |
टाइप |
ब्यौरा |
name |
स्ट्रिंग |
एक्ज़ीक्यूट किया जाने वाला निर्देश. |
parameters |
ऑब्जेक्ट |
कमांड की डेफ़िनिशन के हिसाब से कमांड इनपुट पैरामीटर. कृपया उदाहरणों के लिए OSC API की खास बातें देखें. |
आउटपुट
नाम |
टाइप |
ब्यौरा |
name |
स्ट्रिंग |
एक्ज़ीक्यूट किया जाने वाला निर्देश. |
state |
स्ट्रिंग |
निर्देश की स्थिति. इनमें से कोई एक होना चाहिए:
done - पूरा हुआ, इस जवाब में नतीजे दिख गए हैं.
inProgress - स्क्रिप्ट चलाने की प्रोसेस अब भी चल रही है.
error - कार्रवाई नहीं की जा सकी, जवाब में गड़बड़ी देखें.
|
id |
स्ट्रिंग (ज़रूरी नहीं) |
निर्देश आईडी. यह वैल्यू,
inProgress स्टेटस दिखाने वाले कमांड के लिए ज़रूरी है. उदाहरण के लिए, स्टिचिंग की ज़रूरत की वजह से, camera.takePicture निर्देश में कुछ सेकंड लगते हैं. ज़्यादा जानकारी के लिए, “स्थिति” सेक्शन देखें. |
results |
ऑब्जेक्ट (ज़रूरी नहीं) |
कमांड से जुड़े नतीजे. अगर कमांड से नतीजे मिलने की उम्मीद हो, तो यह स्टेटस
done के लिए, यह वैल्यू डालना ज़रूरी है; उदाहरण के लिए,
“results” : {
“AAA”: “BBB”,
...
} पर स्विच करने के मकसद से, हमसे संपर्क करने के लिए धन्यवाद.
कृपया उदाहरणों के लिए, OSC API की खास बातें देखें. |
error |
ऑब्जेक्ट (ज़रूरी नहीं) |
निर्देश की गड़बड़ी की जानकारी. यह वैल्यू, error; की वैल्यू दिखाने वाले कमांड के लिए ज़रूरी है. उदाहरण के लिए,
“error”: {
“code”: “missingParameter”
} |
progress |
ऑब्जेक्ट (ज़रूरी नहीं) |
निर्देश की प्रोग्रेस की जानकारी. यह वैल्यू, inProgress की स्थिति दिखाने वाले कमांड के लिए ज़रूरी है; उदाहरण के लिए,
“progress”: {
“completion”: 0.8
} |
गड़बड़ी
गड़बड़ी का कोड |
ब्यौरा |
unknownCommand |
अनुरोध किया गया निर्देश अज्ञात है, जैसे कि अगर कोई v2 क्लाइंट (clientVersion 2 पर सेट हो, तो Options देखें) जो एपीआई लेवल 1 से अब काम नहीं करने वाले निर्देश का अनुरोध करता है, तो अनुरोध इस गड़बड़ी कोड के साथ पूरा नहीं होना चाहिए. |
disabledCommand |
फ़िलहाल, चलाया गया निर्देश बंद है, जैसे कि `takeपिक्चर` कमांड बंद होने पर,
कैमरा, वीडियो मोड है. अगर कैमरा पिछले संसाधन को प्रोसेस करने में मदद नहीं करता है, तो यह निर्देश नहीं मिलता है. गड़बड़ी का यह कोड, एपीआई लेवल 2 में जोड़ा गया था. |
cameraInExclusiveUse |
कैमरे का इस्तेमाल पहले से ही किया जा रहा है. इसलिए, नया सेशन शुरू नहीं किया जा सकता. गड़बड़ी के इस कोड को एपीआई लेवल 2 में बंद कर दिया गया था. |
missingParameter |
एक या उससे ज़्यादा ज़रूरी पैरामीटर नहीं बनाए गए थे. |
invalidParameterName |
एक या उससे ज़्यादा इनपुट पैरामीटर या विकल्प के नाम की पहचान नहीं की जा सकी या इस नाम का इस्तेमाल नहीं किया जा सकता. |
invalidParameterValue |
पैरामीटर या विकल्प के नाम की पहचान हो गई थी, लेकिन एक या उससे ज़्यादा वैल्यू अमान्य हैं; उदाहरण के लिए, वैल्यू तय सीमा से बाहर है. |
उदाहरण |
अनुरोध (एपीआई 1) |
POST /osc/commands/execute HTTP/1.1
Host: [camera ip address]:[httpPort]
Content-Type: application/json;charset=utf-8
Accept: application/json
Content-Length: {CONTENT_LENGTH}
X-XSRF-Protected: 1
{
"name": "camera.setOptions",
"parameters": {
"sessionId": "12ABC3",
"options": {
"iso": 200,
"exposureCompensation": -2
}
}
} |
अनुरोध (एपीआई 2) |
POST /osc/commands/execute HTTP/1.1
Host: [camera ip address]:[httpPort]
Content-Type: application/json;charset=utf-8
Accept: application/json
Content-Length: {CONTENT_LENGTH}
X-XSRF-Protected: 1
{
"name": "camera.setOptions",
"parameters": {
"options": {
"iso": 200,
"exposureCompensation": -2
}
}
} |
जवाब |
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: {CONTENT_LENGTH}
X-Content-Type-Options: nosniff
{
"name": "camera.setOptions",
"state": "done"
} |
अनुरोध (एपीआई 1) |
POST /osc/commands/execute HTTP/1.1
Host: [camera ip address]:[httpPort]
Content-Type: application/json;charset=utf-8
Accept: application/json
Content-Length: {CONTENT_LENGTH}
X-XSRF-Protected: 1
{
"name": "camera.takePicture",
"parameters": {
"sessionId": "12ABC3"
}
} |
अनुरोध (एपीआई 2) |
POST /osc/commands/execute HTTP/1.1
Host: [camera ip address]:[httpPort]
Content-Type: application/json;charset=utf-8
Accept: application/json
Content-Length: {CONTENT_LENGTH}
X-XSRF-Protected: 1
{
"name": "camera.takePicture"
} |
जवाब |
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: {CONTENT_LENGTH}
X-Content-Type-Options: nosniff
{
"name": "camera.takePicture",
"state": "inProgress",
"id": "90ABCD",
"progress": {
"completion": 0
}
} |
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2024-08-21 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2024-08-21 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThe \u003ccode\u003e/osc/commands/execute\u003c/code\u003e API allows you to execute commands on the camera, such as adjusting settings or taking pictures.\u003c/p\u003e\n"],["\u003cp\u003eInput requires the command \u003ccode\u003ename\u003c/code\u003e and any necessary \u003ccode\u003eparameters\u003c/code\u003e defined in the OSC API Specification.\u003c/p\u003e\n"],["\u003cp\u003eOutput provides the command \u003ccode\u003ename\u003c/code\u003e, \u003ccode\u003estate\u003c/code\u003e, and may include an \u003ccode\u003eid\u003c/code\u003e, \u003ccode\u003eresults\u003c/code\u003e, \u003ccode\u003eerror\u003c/code\u003e, or \u003ccode\u003eprogress\u003c/code\u003e depending on the command and its execution status.\u003c/p\u003e\n"],["\u003cp\u003ePossible command states include \u003ccode\u003edone\u003c/code\u003e, \u003ccode\u003einProgress\u003c/code\u003e, and \u003ccode\u003eerror\u003c/code\u003e, with further details provided in the output fields.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the OSC API Specification for specific command definitions, parameters, and result formats.\u003c/p\u003e\n"]]],["The `/osc/commands/execute` API triggers commands on a camera, defined by a command `name` and associated `parameters`. The output indicates the command's `state` (`done`, `inProgress`, or `error`), an optional `id` for `inProgress` commands, `results` for completed commands, or `error` details. Possible errors include `unknownCommand`, `disabledCommand`, `missingParameter`, and `invalidParameterValue`. Example requests demonstrate how to set options and take a picture, with the responses showing command completion or ongoing progress.\n"],null,["# Execute\n\nThe `/osc/commands/execute` API executes specified commands on the camera. The output is a command object.\n\nInput\n-----\n\n| Name | Type | Description |\n|--------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | String | The command to be executed. |\n| `parameters` | Object | Command input parameters according to the command definitions specification. Please refer to [OSC API Specification](/streetview/open-spherical-camera/reference/camera) for examples. |\n\nOutput\n------\n\n| Name | Type | Description |\n|------------|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | String | The command to be executed. |\n| `state` | String | State of the command. Should be one of the following: - `done` - Complete, results have been returned in this response. - `inProgress` - Execution is still in progress. - `error` - Failed, see error in the response. |\n| `id` | String (optional) | Command ID. This value is required for commands returning the status`inProgress`. For example, the `camera.takePicture` command takes a few seconds due to the need for stitching. See the \"Status\" section for more details. |\n| `results` | Object (optional) | Command results. This value is required for commands returning state`done` if the command is expected to return results; for example, \"results\" : { \"AAA\": \"BBB\", ... } Please refer to [OSC API Specification](/streetview/open-spherical-camera/reference/camera) for examples. |\n| `error` | Object (optional) | Command error description. This value is required for commands returning state `error;` for example, ```text “error”: { “code”: “missingParameter” } ``` |\n| `progress` | Object (optional) | Command progress description. This value is required for commands returning state `inProgress`; for example, ```text “progress”: { “completion”: 0.8 } ``` |\n\nError\n-----\n\n| Error code | Description |\n|-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `unknownCommand` | Requested command is unknown, e.g. if a v2 client (clientVersion is set to 2, see [Options](/streetview/open-spherical-camera/reference/options)) requests a deprecated command from API level 1, the request should fail with this error code. |\n| `disabledCommand` | Command executed is currently disabled, e.g. \\`takePicture\\` command is disabled when camera is video mode, processPicture command is disabled when the camera doesn't support delayProcessing. **This error code was added in API level 2.** |\n| `cameraInExclusiveUse` | Camera is already in exclusive use, new session can't be started. **This error code was deprecated in API level 2.** |\n| `missingParameter` | One or more required parameters were not specified. |\n| `invalidParameterName` | One or more input parameter or option name was unrecognized or unsupported. |\n| `invalidParameterValue` | The parameter or option names were recognized, but one or more values is invalid; for example, the value is out of range. |\n\n| Example ------- ||\n|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Request (API 1)** | ```http POST /osc/commands/execute HTTP/1.1 Host: [camera ip address]:[httpPort] Content-Type: application/json;charset=utf-8 Accept: application/json Content-Length: {CONTENT_LENGTH} X-XSRF-Protected: 1 { \"name\": \"camera.setOptions\", \"parameters\": { \"sessionId\": \"12ABC3\", \"options\": { \"iso\": 200, \"exposureCompensation\": -2 } } } ``` |\n| **Request (API 2)** | ```http POST /osc/commands/execute HTTP/1.1 Host: [camera ip address]:[httpPort] Content-Type: application/json;charset=utf-8 Accept: application/json Content-Length: {CONTENT_LENGTH} X-XSRF-Protected: 1 { \"name\": \"camera.setOptions\", \"parameters\": { \"options\": { \"iso\": 200, \"exposureCompensation\": -2 } } } ``` |\n| **Response** | ```http HTTP/1.1 200 OK Content-Type: application/json;charset=utf-8 Content-Length: {CONTENT_LENGTH} X-Content-Type-Options: nosniff { \"name\": \"camera.setOptions\", \"state\": \"done\" } ``` |\n| **Request (API 1)** | ```http POST /osc/commands/execute HTTP/1.1 Host: [camera ip address]:[httpPort] Content-Type: application/json;charset=utf-8 Accept: application/json Content-Length: {CONTENT_LENGTH} X-XSRF-Protected: 1 { \"name\": \"camera.takePicture\", \"parameters\": { \"sessionId\": \"12ABC3\" } } ``` |\n| **Request (API 2)** | ```http POST /osc/commands/execute HTTP/1.1 Host: [camera ip address]:[httpPort] Content-Type: application/json;charset=utf-8 Accept: application/json Content-Length: {CONTENT_LENGTH} X-XSRF-Protected: 1 { \"name\": \"camera.takePicture\" } ``` |\n| **Response** | ```http HTTP/1.1 200 OK Content-Type: application/json;charset=utf-8 Content-Length: {CONTENT_LENGTH} X-Content-Type-Options: nosniff { \"name\": \"camera.takePicture\", \"state\": \"inProgress\", \"id\": \"90ABCD\", \"progress\": { \"completion\": 0 } } ``` |"]]