PageRenderTime 3201ms CodeModel.GetById 48ms RepoModel.GetById 3ms app.codeStats 0ms

/wp-content/plugins/backwpup/sdk/WindowsAzure/Blob/Internal/IBlob.php

https://bitbucket.org/cesarmedrano/cesarmedrano
PHP | 492 lines | 43 code | 35 blank | 414 comment | 0 complexity | 5524937e6d20fb4d1c13a62caa38f636 MD5 | raw file
  1. <?php
  2. /**
  3. * LICENSE: Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. * http://www.apache.org/licenses/LICENSE-2.0
  7. *
  8. * Unless required by applicable law or agreed to in writing, software
  9. * distributed under the License is distributed on an "AS IS" BASIS,
  10. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. * See the License for the specific language governing permissions and
  12. * limitations under the License.
  13. *
  14. * PHP version 5
  15. *
  16. * @category Microsoft
  17. * @package WindowsAzure\Blob\Internal
  18. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  19. * @copyright 2012 Microsoft Corporation
  20. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  21. * @link https://github.com/windowsazure/azure-sdk-for-php
  22. */
  23. namespace WindowsAzure\Blob\Internal;
  24. use WindowsAzure\Common\Internal\FilterableService;
  25. /**
  26. * This interface has all REST APIs provided by Windows Azure for Blob service.
  27. *
  28. * @category Microsoft
  29. * @package WindowsAzure\Blob\Internal
  30. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  31. * @copyright 2012 Microsoft Corporation
  32. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  33. * @version Release: @package_version@
  34. * @link https://github.com/windowsazure/azure-sdk-for-php
  35. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd135733.aspx
  36. */
  37. interface IBlob extends FilterableService
  38. {
  39. /**
  40. * Gets the properties of the Blob service.
  41. *
  42. * @param Models\BlobServiceOptions $options optional blob service options.
  43. *
  44. * @return WindowsAzure\Common\Models\GetServicePropertiesResult
  45. *
  46. * @see http://msdn.microsoft.com/en-us/library/windowsazure/hh452239.aspx
  47. */
  48. public function getServiceProperties($options = null);
  49. /**
  50. * Sets the properties of the Blob service.
  51. *
  52. * @param ServiceProperties $serviceProperties new service properties
  53. * @param Models\BlobServiceOptions $options optional parameters
  54. *
  55. * @return none.
  56. *
  57. * @see http://msdn.microsoft.com/en-us/library/windowsazure/hh452235.aspx
  58. */
  59. public function setServiceProperties($serviceProperties, $options = null);
  60. /**
  61. * Lists all of the containers in the given storage account.
  62. *
  63. * @param Models\ListContainersOptions $options optional parameters
  64. *
  65. * @return WindowsAzure\Blob\Models\ListContainersResult
  66. *
  67. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179352.aspx
  68. */
  69. public function listContainers($options = null);
  70. /**
  71. * Creates a new container in the given storage account.
  72. *
  73. * @param string $container name
  74. * @param Models\CreateContainerOptions $options optional parameters
  75. *
  76. * @return none.
  77. *
  78. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179468.aspx
  79. */
  80. public function createContainer($container, $options = null);
  81. /**
  82. * Creates a new container in the given storage account.
  83. *
  84. * @param string $container name
  85. * @param Models\DeleteContainerOptions $options optional parameters
  86. *
  87. * @return none.
  88. *
  89. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179408.aspx
  90. */
  91. public function deleteContainer($container, $options = null);
  92. /**
  93. * Returns all properties and metadata on the container.
  94. *
  95. * @param string $container name
  96. * @param Models\BlobServiceOptions $options optional parameters
  97. *
  98. * @return Models\GetContainerPropertiesResult
  99. *
  100. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179370.aspx
  101. */
  102. public function getContainerProperties($container, $options = null);
  103. /**
  104. * Returns only user-defined metadata for the specified container.
  105. *
  106. * @param string $container name
  107. * @param Models\BlobServiceOptions $options optional parameters
  108. *
  109. * @return Models\GetContainerPropertiesResult
  110. *
  111. * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee691976.aspx
  112. */
  113. public function getContainerMetadata($container, $options = null);
  114. /**
  115. * Gets the access control list (ACL) and any container-level access policies
  116. * for the container.
  117. *
  118. * @param string $container name
  119. * @param Models\BlobServiceOptions $options optional parameters
  120. *
  121. * @return Models\GetContainerAclResult
  122. *
  123. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179469.aspx
  124. */
  125. public function getContainerAcl($container, $options = null);
  126. /**
  127. * Sets the ACL and any container-level access policies for the container.
  128. *
  129. * @param string $container name
  130. * @param Models\ContainerAcl $acl access control list for container
  131. * @param Models\BlobServiceOptions $options optional parameters
  132. *
  133. * @return none.
  134. *
  135. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179391.aspx
  136. */
  137. public function setContainerAcl($container, $acl, $options = null);
  138. /**
  139. * Sets metadata headers on the container.
  140. *
  141. * @param string $container name
  142. * @param array $metadata metadata key/value pair.
  143. * @param Models\SetContainerMetadataOptions $options optional parameters
  144. *
  145. * @return none.
  146. *
  147. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179362.aspx
  148. */
  149. public function setContainerMetadata($container, $metadata, $options = null);
  150. /**
  151. * Lists all of the blobs in the given container.
  152. *
  153. * @param string $container name
  154. * @param Models\ListBlobsOptions $options optional parameters
  155. *
  156. * @return Models\ListBlobsResult
  157. *
  158. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd135734.aspx
  159. */
  160. public function listBlobs($container, $options = null);
  161. /**
  162. * Creates a new page blob. Note that calling createPageBlob to create a page
  163. * blob only initializes the blob.
  164. * To add content to a page blob, call createBlobPages method.
  165. *
  166. * @param string $container name of the container
  167. * @param string $blob name of the blob
  168. * @param int $length specifies the maximum size for the
  169. * page blob, up to 1 TB. The page blob size must be aligned to a 512-byte
  170. * boundary.
  171. * @param Models\CreateBlobOptions $options optional parameters
  172. *
  173. * @return CopyBlobResult
  174. *
  175. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179451.aspx
  176. */
  177. public function createPageBlob($container, $blob, $length, $options = null);
  178. /**
  179. * Creates a new block blob or updates the content of an existing block blob.
  180. * Updating an existing block blob overwrites any existing metadata on the blob.
  181. * Partial updates are not supported with createBlockBlob; the content of the
  182. * existing blob is overwritten with the content of the new blob. To perform a
  183. * partial update of the content of a block blob, use the createBlockList method.
  184. *
  185. * @param string $container name of the container
  186. * @param string $blob name of the blob
  187. * @param string $content content of the blob
  188. * @param Models\CreateBlobOptions $options optional parameters
  189. *
  190. * @return CopyBlobResult
  191. *
  192. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179451.aspx
  193. */
  194. public function createBlockBlob($container, $blob, $content, $options = null);
  195. /**
  196. * Clears a range of pages from the blob.
  197. *
  198. * @param string $container name of the container
  199. * @param string $blob name of the blob
  200. * @param Models\PageRange $range Can be up to the value of the
  201. * blob's full size.
  202. * @param Models\CreateBlobPagesOptions $options optional parameters
  203. *
  204. * @return Models\CreateBlobPagesResult.
  205. *
  206. * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee691975.aspx
  207. */
  208. public function clearBlobPages($container, $blob, $range, $options = null);
  209. /**
  210. * Creates a range of pages to a page blob.
  211. *
  212. * @param string $container name of the container
  213. * @param string $blob name of the blob
  214. * @param Models\PageRange $range Can be up to 4 MB in size
  215. * @param string $content the blob contents
  216. * @param Models\CreateBlobPagesOptions $options optional parameters
  217. *
  218. * @return Models\CreateBlobPagesResult.
  219. *
  220. * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee691975.aspx
  221. */
  222. public function createBlobPages($container, $blob, $range, $content,
  223. $options = null
  224. );
  225. /**
  226. * Creates a new block to be committed as part of a block blob.
  227. *
  228. * @param string $container name of the container
  229. * @param string $blob name of the blob
  230. * @param string $blockId must be less than or equal to
  231. * 64 bytes in size. For a given blob, the length of the value specified for the
  232. * blockid parameter must be the same size for each block.
  233. * @param string $content the blob block contents
  234. * @param Models\CreateBlobBlockOptions $options optional parameters
  235. *
  236. * @return none.
  237. *
  238. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd135726.aspx
  239. */
  240. public function createBlobBlock($container, $blob, $blockId, $content,
  241. $options = null
  242. );
  243. /**
  244. * This method writes a blob by specifying the list of block IDs that make up the
  245. * blob. In order to be written as part of a blob, a block must have been
  246. * successfully written to the server in a prior createBlobBlock method.
  247. *
  248. * You can call Put Block List to update a blob by uploading only those blocks
  249. * that have changed, then committing the new and existing blocks together.
  250. * You can do this by specifying whether to commit a block from the committed
  251. * block list or from the uncommitted block list, or to commit the most recently
  252. * uploaded version of the block, whichever list it may belong to.
  253. *
  254. * @param string $container name of the container
  255. * @param string $blob name of the blob
  256. * @param Models\BlockList $blockList the block list entries
  257. * @param Models\CommitBlobBlocksOptions $options optional parameters
  258. *
  259. * @return none.
  260. *
  261. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179467.aspx
  262. */
  263. public function commitBlobBlocks($container, $blob, $blockList, $options = null);
  264. /**
  265. * Retrieves the list of blocks that have been uploaded as part of a block blob.
  266. *
  267. * There are two block lists maintained for a blob:
  268. * 1) Committed Block List: The list of blocks that have been successfully
  269. * committed to a given blob with commitBlobBlocks.
  270. * 2) Uncommitted Block List: The list of blocks that have been uploaded for a
  271. * blob using Put Block (REST API), but that have not yet been committed.
  272. * These blocks are stored in Windows Azure in association with a blob, but do
  273. * not yet form part of the blob.
  274. *
  275. * @param string $container name of the container
  276. * @param string $blob name of the blob
  277. * @param Models\ListBlobBlocksOptions $options optional parameters
  278. *
  279. * @return Models\ListBlobBlocksResult
  280. *
  281. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179400.aspx
  282. */
  283. public function listBlobBlocks($container, $blob, $options = null);
  284. /**
  285. * Returns all properties and metadata on the blob.
  286. *
  287. * @param string $container name of the container
  288. * @param string $blob name of the blob
  289. * @param Models\GetBlobPropertiesOptions $options optional parameters
  290. *
  291. * @return Models\GetBlobPropertiesResult
  292. *
  293. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179394.aspx
  294. */
  295. public function getBlobProperties($container, $blob, $options = null);
  296. /**
  297. * Returns all properties and metadata on the blob.
  298. *
  299. * @param string $container name of the container
  300. * @param string $blob name of the blob
  301. * @param Models\GetBlobMetadataOptions $options optional parameters
  302. *
  303. * @return Models\GetBlobMetadataResult
  304. *
  305. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179350.aspx
  306. */
  307. public function getBlobMetadata($container, $blob, $options = null);
  308. /**
  309. * Returns a list of active page ranges for a page blob. Active page ranges are
  310. * those that have been populated with data.
  311. *
  312. * @param string $container name of the container
  313. * @param string $blob name of the blob
  314. * @param Models\ListPageBlobRangesOptions $options optional parameters
  315. *
  316. * @return Models\ListPageBlobRangesResult
  317. *
  318. * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee691973.aspx
  319. */
  320. public function listPageBlobRanges($container, $blob, $options = null);
  321. /**
  322. * Sets system properties defined for a blob.
  323. *
  324. * @param string $container name of the container
  325. * @param string $blob name of the blob
  326. * @param Models\SetBlobPropertiesOptions $options optional parameters
  327. *
  328. * @return Models\SetBlobPropertiesResult
  329. *
  330. * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee691966.aspx
  331. */
  332. public function setBlobProperties($container, $blob, $options = null);
  333. /**
  334. * Sets metadata headers on the blob.
  335. *
  336. * @param string $container name of the container
  337. * @param string $blob name of the blob
  338. * @param array $metadata key/value pair representation
  339. * @param Models\SetBlobMetadataOptions $options optional parameters
  340. *
  341. * @return Models\SetBlobMetadataResult
  342. *
  343. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179414.aspx
  344. */
  345. public function setBlobMetadata($container, $blob, $metadata, $options = null);
  346. /**
  347. * Reads or downloads a blob from the system, including its metadata and
  348. * properties.
  349. *
  350. * @param string $container name of the container
  351. * @param string $blob name of the blob
  352. * @param Models\GetBlobOptions $options optional parameters
  353. *
  354. * @return Models\GetBlobResult
  355. *
  356. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179440.aspx
  357. */
  358. public function getBlob($container, $blob, $options = null);
  359. /**
  360. * Deletes a blob or blob snapshot.
  361. *
  362. * Note that if the snapshot entry is specified in the $options then only this
  363. * blob snapshot is deleted. To delete all blob snapshots, do not set Snapshot
  364. * and just set getDeleteSnaphotsOnly to true.
  365. *
  366. * @param string $container name of the container
  367. * @param string $blob name of the blob
  368. * @param Models\DeleteBlobOptions $options optional parameters
  369. *
  370. * @return none
  371. *
  372. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179413.aspx
  373. */
  374. public function deleteBlob($container, $blob, $options = null);
  375. /**
  376. * Creates a snapshot of a blob.
  377. *
  378. * @param string $container name of the container
  379. * @param string $blob name of the blob
  380. * @param Models\CreateBlobSnapshotOptions $options optional parameters
  381. *
  382. * @return Models\CreateBlobSnapshotResult
  383. *
  384. * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee691971.aspx
  385. */
  386. public function createBlobSnapshot($container, $blob, $options = null);
  387. /**
  388. * Copies a source blob to a destination blob within the same storage account.
  389. *
  390. * @param string $destinationContainer name of container
  391. * @param string $destinationBlob name of blob
  392. * @param string $sourceContainer name of container
  393. * @param string $sourceBlob name of blob
  394. * @param Models\CopyBlobOptions $options optional parameters
  395. *
  396. * @return CopyBlobResult
  397. *
  398. * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd894037.aspx
  399. */
  400. public function copyBlob($destinationContainer, $destinationBlob,
  401. $sourceContainer, $sourceBlob, $options = null
  402. );
  403. /**
  404. * Establishes an exclusive one-minute write lock on a blob. To write to a locked
  405. * blob, a client must provide a lease ID.
  406. *
  407. * @param string $container name of the container
  408. * @param string $blob name of the blob
  409. * @param Models\AcquireLeaseOptions $options optional parameters
  410. *
  411. * @return Models\AcquireLeaseResult
  412. *
  413. * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee691972.aspx
  414. */
  415. public function acquireLease($container, $blob, $options = null);
  416. /**
  417. * Renews an existing lease
  418. *
  419. * @param string $container name of the container
  420. * @param string $blob name of the blob
  421. * @param string $leaseId lease id when acquiring
  422. * @param Models\BlobServiceOptions $options optional parameters
  423. *
  424. * @return Models\AcquireLeaseResult
  425. *
  426. * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee691972.aspx
  427. */
  428. public function renewLease($container, $blob, $leaseId, $options = null);
  429. /**
  430. * Frees the lease if it is no longer needed so that another client may
  431. * immediately acquire a lease against the blob.
  432. *
  433. * @param string $container name of the container
  434. * @param string $blob name of the blob
  435. * @param string $leaseId lease id when acquiring
  436. * @param Models\BlobServiceOptions $options optional parameters
  437. *
  438. * @return none
  439. *
  440. * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee691972.aspx
  441. */
  442. public function releaseLease($container, $blob, $leaseId, $options = null);
  443. /**
  444. * Ends the lease but ensure that another client cannot acquire a new lease until
  445. * the current lease period has expired.
  446. *
  447. * @param string $container name of the container
  448. * @param string $blob name of the blob
  449. * @param string $leaseId lease id when acquiring
  450. * @param Models\BlobServiceOptions $options optional parameters
  451. *
  452. * @return none
  453. *
  454. * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee691972.aspx
  455. */
  456. public function breakLease($container, $blob, $leaseId, $options = null);
  457. }