এক্সিকিউট
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
/osc/commands/execute
API ক্যামেরায় নির্দিষ্ট কমান্ড চালায়। আউটপুট একটি কমান্ড অবজেক্ট।
নাম | টাইপ | বর্ণনা |
---|
name | স্ট্রিং | আদেশ কার্যকর করতে হবে। |
parameters | অবজেক্ট | কমান্ড সংজ্ঞা স্পেসিফিকেশন অনুযায়ী কমান্ড ইনপুট পরামিতি. উদাহরণের জন্য অনুগ্রহ করে OSC API স্পেসিফিকেশন পড়ুন। |
আউটপুট
নাম | টাইপ | বর্ণনা |
---|
name | স্ট্রিং | আদেশ কার্যকর করতে হবে। |
state | স্ট্রিং | আদেশের অবস্থা। নিম্নলিখিতগুলির মধ্যে একটি হওয়া উচিত:-
done - সম্পূর্ণ, ফলাফল এই প্রতিক্রিয়াতে ফিরে এসেছে। -
inProgress - এক্সিকিউশন এখনও চলছে। -
error - ব্যর্থ, প্রতিক্রিয়াতে ত্রুটি দেখুন।
|
id | স্ট্রিং (ঐচ্ছিক) | কমান্ড আইডি। স্ট্যাটাস প্রদানকারী কমান্ডের জন্য এই মানটি প্রয়োজন অগ্রগতি উদাহরণস্বরূপ, camera.takePicture কমান্ডটি সেলাই করার প্রয়োজনের কারণে কয়েক সেকেন্ড সময় নেয়। আরও বিস্তারিত জানার জন্য "স্থিতি" বিভাগটি দেখুন। |
results | বস্তু (ঐচ্ছিক) | কমান্ড ফলাফল. কমান্ড রিটার্নিং স্টেটের জন্য এই মানটি প্রয়োজন যদি কমান্ডটি ফলাফল ফেরত দেবে বলে আশা করা হয়; উদাহরণস্বরূপ, "ফলাফল" : { "AAA": "BBB", ... } উদাহরণের জন্য অনুগ্রহ করে OSC API স্পেসিফিকেশন দেখুন। |
error | বস্তু (ঐচ্ছিক) | কমান্ড ত্রুটি বিবরণ. এই মানটি রাষ্ট্রীয় error; উদাহরণস্বরূপ,“error”: {
“code”: “missingParameter”
} |
progress | বস্তু (ঐচ্ছিক) | কমান্ডের অগ্রগতির বিবরণ। এই মানটি প্রবর্তিত অবস্থায় inProgress কমান্ডের জন্য প্রয়োজন; উদাহরণস্বরূপ,“progress”: {
“completion”: 0.8
} |
ত্রুটি
ত্রুটি কোড | বর্ণনা |
---|
unknownCommand | অনুরোধ করা কমান্ড অজানা, যেমন যদি একটি v2 ক্লায়েন্ট (ক্লায়েন্ট সংস্করণ 2 তে সেট করা হয়, বিকল্পগুলি দেখুন ) API স্তর 1 থেকে একটি অবচ্যুত কমান্ডের অনুরোধ করে, অনুরোধটি এই ত্রুটি কোডের সাথে ব্যর্থ হওয়া উচিত। |
disabledCommand | এক্সিকিউট করা কমান্ডটি বর্তমানে অক্ষম করা আছে, যেমন ক্যামেরা ভিডিও মোড হলে `টেকপিকচার` কমান্ড নিষ্ক্রিয় করা হয়, যখন ক্যামেরা বিলম্ব প্রক্রিয়াকরণ সমর্থন করে না তখন প্রসেসপিকচার কমান্ড নিষ্ক্রিয় করা হয়। এই ত্রুটি কোডটি API স্তর 2 এ যোগ করা হয়েছে। |
cameraInExclusiveUse | ক্যামেরা ইতিমধ্যেই একচেটিয়া ব্যবহারে রয়েছে, নতুন সেশন শুরু করা যাবে না। এপিআই লেভেল 2-এ এই ত্রুটি কোডটি বাতিল করা হয়েছে। |
missingParameter | এক বা একাধিক প্রয়োজনীয় পরামিতি নির্দিষ্ট করা হয়নি। |
invalidParameterName | এক বা একাধিক ইনপুট প্যারামিটার বা বিকল্পের নাম অস্বীকৃত বা অসমর্থিত ছিল। |
invalidParameterValue | প্যারামিটার বা বিকল্পের নাম স্বীকৃত হয়েছে, কিন্তু এক বা একাধিক মান অবৈধ; উদাহরণস্বরূপ, মান পরিসীমার বাইরে। |
উদাহরণ |
---|
অনুরোধ (API 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
}
}
} |
অনুরোধ (API 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"
} |
অনুরোধ (API 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"
}
} |
অনুরোধ (API 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 সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2024-11-13 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2024-11-13 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 } } ``` |"]]