ExternalBundle[{"name1"obj1,"name2"obj2,…}]
名前付きのURL,関数等として外部的に配備されるリソースのバンドルを表す.
ExternalBundle[{name11{name1…,…},…}]
リソースのネストされたバンドルを表す.
ExternalBundle
ExternalBundle[{"name1"obj1,"name2"obj2,…}]
名前付きのURL,関数等として外部的に配備されるリソースのバンドルを表す.
ExternalBundle[{name11{name1…,…},…}]
リソースのネストされたバンドルを表す.
詳細
- ExternalBundleは,CloudDeploy中,あるいはWebの配備先についてはEmbedCode中で,事実上,クラウド中のディレクトリあるいはディレクトリの階層のコンテンツを定義する.
- ExternalBundleは,言語についてはEmbedCode内で,名前付きの外部関数のバンドルを定義する.
例題
すべて開く すべて閉じる例 (1)
bundle = CloudDeploy[ExternalBundle[{"factor" -> APIFunction["n" -> "Integer", FactorInteger[#n]&], "primeq" -> APIFunction["n" -> "Integer", PrimeQ[#n]&]}]]contents = Get[bundle]URLExecute[Lookup[First[contents], "factor"], {"n" -> 187}]スコープ (2)
サブディレクトリを作って,ネストした規則のリストを持つバンドルを作る:
bundle = CloudDeploy[
ExternalBundle[
{
"api" -> {"factor" -> APIFunction["n" -> "Integer", FactorInteger[#n]&], "primeq" -> APIFunction["n" -> "Integer", PrimeQ[#n]&]},
"form" -> {"factor" -> FormPage["n" -> "Integer", FactorInteger[#n]&], "primeq" -> FormPage["n" -> "Integer", PrimeQ[#n]&]}
}]]Get[bundle]bundle = CloudDeploy[ExternalBundle[{"square" -> APIFunction[{"s" -> "Integer"}, #x^2&], "root" -> APIFunction[{"r" -> "Integer"}, Sqrt[#x]&]}]]
EmbedCode[bundle]特性と関係 (2)
同様の効果は,ディレクトリ内で個々のオブジェクトを配置および管理することによって達成できる.プロジェクト用ディレクトリを作成する:
dir = CreateDirectory[CloudObject["api-bundle"]]CloudDeploy[APIFunction["n" -> "Integer", FactorInteger[#n]&], CloudObject["factor", dir]]
CloudDeploy[APIFunction["n" -> "Integer", PrimeQ[#n]&], CloudObject["primeq", dir]]プロジェクトディレクトリのコンテンツは配備されたAPIである:
CloudObjects[dir]このアプローチとの主な相違点は,ExternalBundleの内部にあるオブジェクトが一段階で配備される点にある.
URLDispatcherを用いて同様の効果を得ることもできる:
dispatch = CloudDeploy[URLDispatcher[{
"/factor" :> APIFunction["n" -> "Integer", FactorInteger[#n]&],
"/primeq" :> APIFunction["n" -> "Integer", PrimeQ[#n]&]
}]]ディスパッチャは,当該オブジェクトのURLの後に続くURLパターンに基づいて要求に応答する単一のオブジェクトである.因数分解を行うAPIFunctionを有効にするためには,そのURLの後に"/factor"を付加してディスパッチャを呼び出す:
URLExecute[CloudObject["factor", dispatch], {"n" -> 187}]テキスト
Wolfram Research (2014), ExternalBundle, Wolfram言語関数, https://reference.wolfram.com/language/ref/ExternalBundle.html.
CMS
Wolfram Language. 2014. "ExternalBundle." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ExternalBundle.html.
APA
Wolfram Language. (2014). ExternalBundle. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ExternalBundle.html
BibTeX
@misc{reference.wolfram_2026_externalbundle, author="Wolfram Research", title="{ExternalBundle}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/ExternalBundle.html}", note=[Accessed: 13-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_externalbundle, organization={Wolfram Research}, title={ExternalBundle}, year={2014}, url={https://reference.wolfram.com/language/ref/ExternalBundle.html}, note=[Accessed: 13-September-2026]}