PageRenderTime 233ms CodeModel.GetById 34ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/github.com/Azure/azure-sdk-for-go/datalake-store/filesystem/group.go

https://gitlab.com/unofficial-mirrors/openshift-origin
Go | 1121 lines | 772 code | 136 blank | 213 comment | 114 complexity | 0d2b39badee61285136282c1c3a4f6ae MD5 | raw file
  1. package filesystem
  2. // Copyright (c) Microsoft and contributors. All rights reserved.
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. //
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. // Code generated by Microsoft (R) AutoRest Code Generator.
  17. // Changes may cause incorrect behavior and will be lost if the code is regenerated.
  18. import (
  19. "github.com/Azure/go-autorest/autorest"
  20. "github.com/Azure/go-autorest/autorest/azure"
  21. "github.com/Azure/go-autorest/autorest/validation"
  22. uuid "github.com/satori/go.uuid"
  23. "io"
  24. "net/http"
  25. )
  26. // GroupClient is the creates an Azure Data Lake Store filesystem client.
  27. type GroupClient struct {
  28. ManagementClient
  29. }
  30. // NewGroupClient creates an instance of the GroupClient client.
  31. func NewGroupClient() GroupClient {
  32. return GroupClient{New()}
  33. }
  34. // Append used for serial appends to the specified file. NOTE: The target must not contain data added by
  35. // ConcurrentAppend. ConcurrentAppend and Append cannot be used interchangeably; once a target file has been modified
  36. // using either of these append options, the other append option cannot be used on the target file.
  37. //
  38. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  39. // Store path (starting with '/') of the file to which to append. streamContents is the file contents to include when
  40. // appending to the file. streamContents will be closed upon successful return. Callers should ensure closure when
  41. // receiving an error.appendParameter is flag to skip redirection. When append=false or not specified, the request is
  42. // redirected. Submit another HTTP PUT request using the URL in the Location header with the file data to be written.
  43. // When append=true, this redirection is skipped. op is the constant value for the operation. offset is the optional
  44. // offset in the stream to begin the append operation. Default is to append at the end of the stream. syncFlag is
  45. // optionally indicates what to do after completion of the concurrent append. DATA indicates that more data will be
  46. // sent immediately by the client, the file handle should remain open/locked, and file metadata (including file length,
  47. // last modified time) should NOT get updated. METADATA indicates that more data will be sent immediately by the
  48. // client, the file handle should remain open/locked, and file metadata should get updated. CLOSE indicates that the
  49. // client is done sending data, the file handle should be closed/unlocked, and file metadata should get updated.
  50. // leaseID is optional unique GUID per file to ensure single writer semantics, meaning that only clients that append to
  51. // the file with the same leaseId will be allowed to do so. fileSessionID is optional unique GUID per file indicating
  52. // all the appends with the same fileSessionId are from the same client and same session. This will give a performance
  53. // benefit when syncFlag is DATA or METADATA.
  54. //
  55. // Deprecated: Please use github.com/Azure/azure-sdk-for-go/services/datalake/store/2016-11-01/filesystem
  56. func (client GroupClient) Append(accountName string, pathParameter string, streamContents io.ReadCloser, appendParameter string, op string, offset *int64, syncFlag SyncFlag, leaseID *uuid.UUID, fileSessionID *uuid.UUID) (result autorest.Response, err error) {
  57. req, err := client.AppendPreparer(accountName, pathParameter, streamContents, appendParameter, op, offset, syncFlag, leaseID, fileSessionID)
  58. if err != nil {
  59. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "Append", nil, "Failure preparing request")
  60. return
  61. }
  62. resp, err := client.AppendSender(req)
  63. if err != nil {
  64. result.Response = resp
  65. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "Append", resp, "Failure sending request")
  66. return
  67. }
  68. result, err = client.AppendResponder(resp)
  69. if err != nil {
  70. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "Append", resp, "Failure responding to request")
  71. }
  72. return
  73. }
  74. // AppendPreparer prepares the Append request.
  75. func (client GroupClient) AppendPreparer(accountName string, pathParameter string, streamContents io.ReadCloser, appendParameter string, op string, offset *int64, syncFlag SyncFlag, leaseID *uuid.UUID, fileSessionID *uuid.UUID) (*http.Request, error) {
  76. urlParameters := map[string]interface{}{
  77. "accountName": accountName,
  78. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  79. }
  80. pathParameters := map[string]interface{}{
  81. "path": autorest.Encode("path", pathParameter),
  82. }
  83. const APIVersion = "2016-11-01"
  84. queryParameters := map[string]interface{}{
  85. "api-version": APIVersion,
  86. "append": autorest.Encode("query", appendParameter),
  87. "op": autorest.Encode("query", op),
  88. }
  89. if offset != nil {
  90. queryParameters["offset"] = autorest.Encode("query", *offset)
  91. }
  92. if len(string(syncFlag)) > 0 {
  93. queryParameters["syncFlag"] = autorest.Encode("query", syncFlag)
  94. }
  95. if leaseID != nil {
  96. queryParameters["leaseId"] = autorest.Encode("query", *leaseID)
  97. }
  98. if fileSessionID != nil {
  99. queryParameters["fileSessionId"] = autorest.Encode("query", *fileSessionID)
  100. }
  101. preparer := autorest.CreatePreparer(
  102. autorest.AsPost(),
  103. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  104. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  105. autorest.WithFile(streamContents),
  106. autorest.WithQueryParameters(queryParameters))
  107. return preparer.Prepare(&http.Request{})
  108. }
  109. // AppendSender sends the Append request. The method will close the
  110. // http.Response Body if it receives an error.
  111. func (client GroupClient) AppendSender(req *http.Request) (*http.Response, error) {
  112. return autorest.SendWithSender(client,
  113. req,
  114. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  115. }
  116. // AppendResponder handles the response to the Append request. The method always
  117. // closes the http.Response Body.
  118. func (client GroupClient) AppendResponder(resp *http.Response) (result autorest.Response, err error) {
  119. err = autorest.Respond(
  120. resp,
  121. client.ByInspecting(),
  122. azure.WithErrorUnlessStatusCode(http.StatusOK),
  123. autorest.ByClosing())
  124. result.Response = resp
  125. return
  126. }
  127. // CheckAccess checks if the specified access is available at the given path.
  128. //
  129. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  130. // Store path (starting with '/') of the file or directory for which to check access. fsaction is file system operation
  131. // read/write/execute in string form, matching regex pattern '[rwx-]{3}' op is the constant value for the operation.
  132. func (client GroupClient) CheckAccess(accountName string, pathParameter string, fsaction string, op string) (result autorest.Response, err error) {
  133. req, err := client.CheckAccessPreparer(accountName, pathParameter, fsaction, op)
  134. if err != nil {
  135. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "CheckAccess", nil, "Failure preparing request")
  136. return
  137. }
  138. resp, err := client.CheckAccessSender(req)
  139. if err != nil {
  140. result.Response = resp
  141. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "CheckAccess", resp, "Failure sending request")
  142. return
  143. }
  144. result, err = client.CheckAccessResponder(resp)
  145. if err != nil {
  146. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "CheckAccess", resp, "Failure responding to request")
  147. }
  148. return
  149. }
  150. // CheckAccessPreparer prepares the CheckAccess request.
  151. func (client GroupClient) CheckAccessPreparer(accountName string, pathParameter string, fsaction string, op string) (*http.Request, error) {
  152. urlParameters := map[string]interface{}{
  153. "accountName": accountName,
  154. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  155. }
  156. pathParameters := map[string]interface{}{
  157. "path": autorest.Encode("path", pathParameter),
  158. }
  159. const APIVersion = "2016-11-01"
  160. queryParameters := map[string]interface{}{
  161. "api-version": APIVersion,
  162. "fsaction": autorest.Encode("query", fsaction),
  163. "op": autorest.Encode("query", op),
  164. }
  165. preparer := autorest.CreatePreparer(
  166. autorest.AsGet(),
  167. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  168. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  169. autorest.WithQueryParameters(queryParameters))
  170. return preparer.Prepare(&http.Request{})
  171. }
  172. // CheckAccessSender sends the CheckAccess request. The method will close the
  173. // http.Response Body if it receives an error.
  174. func (client GroupClient) CheckAccessSender(req *http.Request) (*http.Response, error) {
  175. return autorest.SendWithSender(client,
  176. req,
  177. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  178. }
  179. // CheckAccessResponder handles the response to the CheckAccess request. The method always
  180. // closes the http.Response Body.
  181. func (client GroupClient) CheckAccessResponder(resp *http.Response) (result autorest.Response, err error) {
  182. err = autorest.Respond(
  183. resp,
  184. client.ByInspecting(),
  185. azure.WithErrorUnlessStatusCode(http.StatusOK),
  186. autorest.ByClosing())
  187. result.Response = resp
  188. return
  189. }
  190. // Concat concatenates the list of source files into the destination file, removing all source files upon success.
  191. //
  192. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  193. // Store path (starting with '/') of the destination file resulting from the concatenation. sources is a list of comma
  194. // separated Data Lake Store paths (starting with '/') of the files to concatenate, in the order in which they should
  195. // be concatenated. op is the constant value for the operation.
  196. func (client GroupClient) Concat(accountName string, pathParameter string, sources []string, op string) (result autorest.Response, err error) {
  197. if err := validation.Validate([]validation.Validation{
  198. {TargetValue: sources,
  199. Constraints: []validation.Constraint{{Target: "sources", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
  200. return result, validation.NewErrorWithValidationError(err, "filesystem.GroupClient", "Concat")
  201. }
  202. req, err := client.ConcatPreparer(accountName, pathParameter, sources, op)
  203. if err != nil {
  204. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "Concat", nil, "Failure preparing request")
  205. return
  206. }
  207. resp, err := client.ConcatSender(req)
  208. if err != nil {
  209. result.Response = resp
  210. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "Concat", resp, "Failure sending request")
  211. return
  212. }
  213. result, err = client.ConcatResponder(resp)
  214. if err != nil {
  215. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "Concat", resp, "Failure responding to request")
  216. }
  217. return
  218. }
  219. // ConcatPreparer prepares the Concat request.
  220. func (client GroupClient) ConcatPreparer(accountName string, pathParameter string, sources []string, op string) (*http.Request, error) {
  221. urlParameters := map[string]interface{}{
  222. "accountName": accountName,
  223. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  224. }
  225. pathParameters := map[string]interface{}{
  226. "path": autorest.Encode("path", pathParameter),
  227. }
  228. const APIVersion = "2016-11-01"
  229. queryParameters := map[string]interface{}{
  230. "api-version": APIVersion,
  231. "op": autorest.Encode("query", op),
  232. "sources": autorest.Encode("query", sources, ","),
  233. }
  234. preparer := autorest.CreatePreparer(
  235. autorest.AsPost(),
  236. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  237. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  238. autorest.WithQueryParameters(queryParameters))
  239. return preparer.Prepare(&http.Request{})
  240. }
  241. // ConcatSender sends the Concat request. The method will close the
  242. // http.Response Body if it receives an error.
  243. func (client GroupClient) ConcatSender(req *http.Request) (*http.Response, error) {
  244. return autorest.SendWithSender(client,
  245. req,
  246. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  247. }
  248. // ConcatResponder handles the response to the Concat request. The method always
  249. // closes the http.Response Body.
  250. func (client GroupClient) ConcatResponder(resp *http.Response) (result autorest.Response, err error) {
  251. err = autorest.Respond(
  252. resp,
  253. client.ByInspecting(),
  254. azure.WithErrorUnlessStatusCode(http.StatusOK),
  255. autorest.ByClosing())
  256. result.Response = resp
  257. return
  258. }
  259. // ConcurrentAppend appends to the specified file, optionally first creating the file if it does not yet exist. This
  260. // method supports multiple concurrent appends to the file. NOTE: The target must not contain data added by Create or
  261. // normal (serial) Append. ConcurrentAppend and Append cannot be used interchangeably; once a target file has been
  262. // modified using either of these append options, the other append option cannot be used on the target file.
  263. // ConcurrentAppend does not guarantee order and can result in duplicated data landing in the target file.
  264. //
  265. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  266. // Store path (starting with '/') of the file to which to append using concurrent append. streamContents is the file
  267. // contents to include when appending to the file. streamContents will be closed upon successful return. Callers should
  268. // ensure closure when receiving an error.op is the constant value for the operation. transferEncoding is indicates the
  269. // data being sent to the server is being streamed in chunks. appendMode is indicates the concurrent append call should
  270. // create the file if it doesn't exist or just open the existing file for append syncFlag is optionally indicates what
  271. // to do after completion of the concurrent append. DATA indicates that more data will be sent immediately by the
  272. // client, the file handle should remain open/locked, and file metadata (including file length, last modified time)
  273. // should NOT get updated. METADATA indicates that more data will be sent immediately by the client, the file handle
  274. // should remain open/locked, and file metadata should get updated. CLOSE indicates that the client is done sending
  275. // data, the file handle should be closed/unlocked, and file metadata should get updated.
  276. func (client GroupClient) ConcurrentAppend(accountName string, pathParameter string, streamContents io.ReadCloser, op string, transferEncoding string, appendMode AppendModeType, syncFlag SyncFlag) (result autorest.Response, err error) {
  277. req, err := client.ConcurrentAppendPreparer(accountName, pathParameter, streamContents, op, transferEncoding, appendMode, syncFlag)
  278. if err != nil {
  279. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "ConcurrentAppend", nil, "Failure preparing request")
  280. return
  281. }
  282. resp, err := client.ConcurrentAppendSender(req)
  283. if err != nil {
  284. result.Response = resp
  285. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "ConcurrentAppend", resp, "Failure sending request")
  286. return
  287. }
  288. result, err = client.ConcurrentAppendResponder(resp)
  289. if err != nil {
  290. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "ConcurrentAppend", resp, "Failure responding to request")
  291. }
  292. return
  293. }
  294. // ConcurrentAppendPreparer prepares the ConcurrentAppend request.
  295. func (client GroupClient) ConcurrentAppendPreparer(accountName string, pathParameter string, streamContents io.ReadCloser, op string, transferEncoding string, appendMode AppendModeType, syncFlag SyncFlag) (*http.Request, error) {
  296. urlParameters := map[string]interface{}{
  297. "accountName": accountName,
  298. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  299. }
  300. pathParameters := map[string]interface{}{
  301. "path": autorest.Encode("path", pathParameter),
  302. }
  303. const APIVersion = "2016-11-01"
  304. queryParameters := map[string]interface{}{
  305. "api-version": APIVersion,
  306. "op": autorest.Encode("query", op),
  307. }
  308. if len(string(appendMode)) > 0 {
  309. queryParameters["appendMode"] = autorest.Encode("query", appendMode)
  310. }
  311. if len(string(syncFlag)) > 0 {
  312. queryParameters["syncFlag"] = autorest.Encode("query", syncFlag)
  313. }
  314. preparer := autorest.CreatePreparer(
  315. autorest.AsPost(),
  316. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  317. autorest.WithPathParameters("/WebHdfsExt/{path}", pathParameters),
  318. autorest.WithFile(streamContents),
  319. autorest.WithQueryParameters(queryParameters),
  320. autorest.WithHeader("Transfer-Encoding", autorest.String(transferEncoding)))
  321. return preparer.Prepare(&http.Request{})
  322. }
  323. // ConcurrentAppendSender sends the ConcurrentAppend request. The method will close the
  324. // http.Response Body if it receives an error.
  325. func (client GroupClient) ConcurrentAppendSender(req *http.Request) (*http.Response, error) {
  326. return autorest.SendWithSender(client,
  327. req,
  328. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  329. }
  330. // ConcurrentAppendResponder handles the response to the ConcurrentAppend request. The method always
  331. // closes the http.Response Body.
  332. func (client GroupClient) ConcurrentAppendResponder(resp *http.Response) (result autorest.Response, err error) {
  333. err = autorest.Respond(
  334. resp,
  335. client.ByInspecting(),
  336. azure.WithErrorUnlessStatusCode(http.StatusOK),
  337. autorest.ByClosing())
  338. result.Response = resp
  339. return
  340. }
  341. // Create creates a file with optionally specified content. NOTE: If content is provided, the resulting file cannot be
  342. // modified using ConcurrentAppend.
  343. //
  344. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  345. // Store path (starting with '/') of the file to create. write is flag to skip redirection. When write=false or not
  346. // specified, the request is redirected. Submit another HTTP PUT request using the URL in the Location header with the
  347. // file data to be written. When write=true, this redirection is skipped. op is the constant value for the operation.
  348. // streamContents is the file contents to include when creating the file. This parameter is optional, resulting in an
  349. // empty file if not specified. streamContents will be closed upon successful return. Callers should ensure closure
  350. // when receiving an error.overwrite is the indication of if the file should be overwritten. syncFlag is optionally
  351. // indicates what to do after completion of the create. DATA indicates that more data will be sent immediately by the
  352. // client, the file handle should remain open/locked, and file metadata (including file length, last modified time)
  353. // should NOT get updated. METADATA indicates that more data will be sent immediately by the client, the file handle
  354. // should remain open/locked, and file metadata should get updated. CLOSE indicates that the client is done sending
  355. // data, the file handle should be closed/unlocked, and file metadata should get updated. leaseID is optional unique
  356. // GUID per file to ensure single writer semantics, meaning that only clients that append to the file with the same
  357. // leaseId will be allowed to do so. permission is the octal representation of the unnamed user, mask and other
  358. // permissions that should be set for the file when created. If not specified, it inherits these from the container.
  359. func (client GroupClient) Create(accountName string, pathParameter string, write string, op string, streamContents io.ReadCloser, overwrite *bool, syncFlag SyncFlag, leaseID *uuid.UUID, permission *int32) (result autorest.Response, err error) {
  360. req, err := client.CreatePreparer(accountName, pathParameter, write, op, streamContents, overwrite, syncFlag, leaseID, permission)
  361. if err != nil {
  362. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "Create", nil, "Failure preparing request")
  363. return
  364. }
  365. resp, err := client.CreateSender(req)
  366. if err != nil {
  367. result.Response = resp
  368. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "Create", resp, "Failure sending request")
  369. return
  370. }
  371. result, err = client.CreateResponder(resp)
  372. if err != nil {
  373. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "Create", resp, "Failure responding to request")
  374. }
  375. return
  376. }
  377. // CreatePreparer prepares the Create request.
  378. func (client GroupClient) CreatePreparer(accountName string, pathParameter string, write string, op string, streamContents io.ReadCloser, overwrite *bool, syncFlag SyncFlag, leaseID *uuid.UUID, permission *int32) (*http.Request, error) {
  379. urlParameters := map[string]interface{}{
  380. "accountName": accountName,
  381. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  382. }
  383. pathParameters := map[string]interface{}{
  384. "path": autorest.Encode("path", pathParameter),
  385. }
  386. const APIVersion = "2016-11-01"
  387. queryParameters := map[string]interface{}{
  388. "api-version": APIVersion,
  389. "op": autorest.Encode("query", op),
  390. "write": autorest.Encode("query", write),
  391. }
  392. if overwrite != nil {
  393. queryParameters["overwrite"] = autorest.Encode("query", *overwrite)
  394. }
  395. if len(string(syncFlag)) > 0 {
  396. queryParameters["syncFlag"] = autorest.Encode("query", syncFlag)
  397. }
  398. if leaseID != nil {
  399. queryParameters["leaseId"] = autorest.Encode("query", *leaseID)
  400. }
  401. if permission != nil {
  402. queryParameters["permission"] = autorest.Encode("query", *permission)
  403. }
  404. preparer := autorest.CreatePreparer(
  405. autorest.AsPut(),
  406. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  407. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  408. autorest.WithQueryParameters(queryParameters))
  409. if streamContents != nil {
  410. preparer = autorest.DecoratePreparer(preparer,
  411. autorest.WithJSON(streamContents))
  412. }
  413. return preparer.Prepare(&http.Request{})
  414. }
  415. // CreateSender sends the Create request. The method will close the
  416. // http.Response Body if it receives an error.
  417. func (client GroupClient) CreateSender(req *http.Request) (*http.Response, error) {
  418. return autorest.SendWithSender(client,
  419. req,
  420. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  421. }
  422. // CreateResponder handles the response to the Create request. The method always
  423. // closes the http.Response Body.
  424. func (client GroupClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) {
  425. err = autorest.Respond(
  426. resp,
  427. client.ByInspecting(),
  428. azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
  429. autorest.ByClosing())
  430. result.Response = resp
  431. return
  432. }
  433. // Delete deletes the requested file or directory, optionally recursively.
  434. //
  435. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  436. // Store path (starting with '/') of the file or directory to delete. op is the constant value for the operation.
  437. // recursive is the optional switch indicating if the delete should be recursive
  438. func (client GroupClient) Delete(accountName string, pathParameter string, op string, recursive *bool) (result FileOperationResult, err error) {
  439. req, err := client.DeletePreparer(accountName, pathParameter, op, recursive)
  440. if err != nil {
  441. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "Delete", nil, "Failure preparing request")
  442. return
  443. }
  444. resp, err := client.DeleteSender(req)
  445. if err != nil {
  446. result.Response = autorest.Response{Response: resp}
  447. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "Delete", resp, "Failure sending request")
  448. return
  449. }
  450. result, err = client.DeleteResponder(resp)
  451. if err != nil {
  452. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "Delete", resp, "Failure responding to request")
  453. }
  454. return
  455. }
  456. // DeletePreparer prepares the Delete request.
  457. func (client GroupClient) DeletePreparer(accountName string, pathParameter string, op string, recursive *bool) (*http.Request, error) {
  458. urlParameters := map[string]interface{}{
  459. "accountName": accountName,
  460. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  461. }
  462. pathParameters := map[string]interface{}{
  463. "path": autorest.Encode("path", pathParameter),
  464. }
  465. const APIVersion = "2016-11-01"
  466. queryParameters := map[string]interface{}{
  467. "api-version": APIVersion,
  468. "op": autorest.Encode("query", op),
  469. }
  470. if recursive != nil {
  471. queryParameters["recursive"] = autorest.Encode("query", *recursive)
  472. }
  473. preparer := autorest.CreatePreparer(
  474. autorest.AsDelete(),
  475. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  476. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  477. autorest.WithQueryParameters(queryParameters))
  478. return preparer.Prepare(&http.Request{})
  479. }
  480. // DeleteSender sends the Delete request. The method will close the
  481. // http.Response Body if it receives an error.
  482. func (client GroupClient) DeleteSender(req *http.Request) (*http.Response, error) {
  483. return autorest.SendWithSender(client,
  484. req,
  485. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  486. }
  487. // DeleteResponder handles the response to the Delete request. The method always
  488. // closes the http.Response Body.
  489. func (client GroupClient) DeleteResponder(resp *http.Response) (result FileOperationResult, err error) {
  490. err = autorest.Respond(
  491. resp,
  492. client.ByInspecting(),
  493. azure.WithErrorUnlessStatusCode(http.StatusOK),
  494. autorest.ByUnmarshallingJSON(&result),
  495. autorest.ByClosing())
  496. result.Response = autorest.Response{Response: resp}
  497. return
  498. }
  499. // GetACLStatus gets Access Control List (ACL) entries for the specified file or directory.
  500. //
  501. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  502. // Store path (starting with '/') of the file or directory for which to get the ACL. op is the constant value for the
  503. // operation. tooID is an optional switch to return friendly names in place of object ID for ACL entries. tooid=false
  504. // returns friendly names instead of the AAD Object ID. Default value is true, returning AAD object IDs.
  505. func (client GroupClient) GetACLStatus(accountName string, pathParameter string, op string, tooID *bool) (result ACLStatusResult, err error) {
  506. req, err := client.GetACLStatusPreparer(accountName, pathParameter, op, tooID)
  507. if err != nil {
  508. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "GetACLStatus", nil, "Failure preparing request")
  509. return
  510. }
  511. resp, err := client.GetACLStatusSender(req)
  512. if err != nil {
  513. result.Response = autorest.Response{Response: resp}
  514. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "GetACLStatus", resp, "Failure sending request")
  515. return
  516. }
  517. result, err = client.GetACLStatusResponder(resp)
  518. if err != nil {
  519. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "GetACLStatus", resp, "Failure responding to request")
  520. }
  521. return
  522. }
  523. // GetACLStatusPreparer prepares the GetACLStatus request.
  524. func (client GroupClient) GetACLStatusPreparer(accountName string, pathParameter string, op string, tooID *bool) (*http.Request, error) {
  525. urlParameters := map[string]interface{}{
  526. "accountName": accountName,
  527. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  528. }
  529. pathParameters := map[string]interface{}{
  530. "path": autorest.Encode("path", pathParameter),
  531. }
  532. const APIVersion = "2016-11-01"
  533. queryParameters := map[string]interface{}{
  534. "api-version": APIVersion,
  535. "op": autorest.Encode("query", op),
  536. }
  537. if tooID != nil {
  538. queryParameters["tooId"] = autorest.Encode("query", *tooID)
  539. }
  540. preparer := autorest.CreatePreparer(
  541. autorest.AsGet(),
  542. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  543. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  544. autorest.WithQueryParameters(queryParameters))
  545. return preparer.Prepare(&http.Request{})
  546. }
  547. // GetACLStatusSender sends the GetACLStatus request. The method will close the
  548. // http.Response Body if it receives an error.
  549. func (client GroupClient) GetACLStatusSender(req *http.Request) (*http.Response, error) {
  550. return autorest.SendWithSender(client,
  551. req,
  552. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  553. }
  554. // GetACLStatusResponder handles the response to the GetACLStatus request. The method always
  555. // closes the http.Response Body.
  556. func (client GroupClient) GetACLStatusResponder(resp *http.Response) (result ACLStatusResult, err error) {
  557. err = autorest.Respond(
  558. resp,
  559. client.ByInspecting(),
  560. azure.WithErrorUnlessStatusCode(http.StatusOK),
  561. autorest.ByUnmarshallingJSON(&result),
  562. autorest.ByClosing())
  563. result.Response = autorest.Response{Response: resp}
  564. return
  565. }
  566. // GetContentSummary gets the file content summary object specified by the file path.
  567. //
  568. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  569. // Store path (starting with '/') of the file for which to retrieve the summary. op is the constant value for the
  570. // operation.
  571. func (client GroupClient) GetContentSummary(accountName string, pathParameter string, op string) (result ContentSummaryResult, err error) {
  572. req, err := client.GetContentSummaryPreparer(accountName, pathParameter, op)
  573. if err != nil {
  574. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "GetContentSummary", nil, "Failure preparing request")
  575. return
  576. }
  577. resp, err := client.GetContentSummarySender(req)
  578. if err != nil {
  579. result.Response = autorest.Response{Response: resp}
  580. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "GetContentSummary", resp, "Failure sending request")
  581. return
  582. }
  583. result, err = client.GetContentSummaryResponder(resp)
  584. if err != nil {
  585. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "GetContentSummary", resp, "Failure responding to request")
  586. }
  587. return
  588. }
  589. // GetContentSummaryPreparer prepares the GetContentSummary request.
  590. func (client GroupClient) GetContentSummaryPreparer(accountName string, pathParameter string, op string) (*http.Request, error) {
  591. urlParameters := map[string]interface{}{
  592. "accountName": accountName,
  593. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  594. }
  595. pathParameters := map[string]interface{}{
  596. "path": autorest.Encode("path", pathParameter),
  597. }
  598. const APIVersion = "2016-11-01"
  599. queryParameters := map[string]interface{}{
  600. "api-version": APIVersion,
  601. "op": autorest.Encode("query", op),
  602. }
  603. preparer := autorest.CreatePreparer(
  604. autorest.AsGet(),
  605. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  606. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  607. autorest.WithQueryParameters(queryParameters))
  608. return preparer.Prepare(&http.Request{})
  609. }
  610. // GetContentSummarySender sends the GetContentSummary request. The method will close the
  611. // http.Response Body if it receives an error.
  612. func (client GroupClient) GetContentSummarySender(req *http.Request) (*http.Response, error) {
  613. return autorest.SendWithSender(client,
  614. req,
  615. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  616. }
  617. // GetContentSummaryResponder handles the response to the GetContentSummary request. The method always
  618. // closes the http.Response Body.
  619. func (client GroupClient) GetContentSummaryResponder(resp *http.Response) (result ContentSummaryResult, err error) {
  620. err = autorest.Respond(
  621. resp,
  622. client.ByInspecting(),
  623. azure.WithErrorUnlessStatusCode(http.StatusOK),
  624. autorest.ByUnmarshallingJSON(&result),
  625. autorest.ByClosing())
  626. result.Response = autorest.Response{Response: resp}
  627. return
  628. }
  629. // GetFileStatus get the file status object specified by the file path.
  630. //
  631. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  632. // Store path (starting with '/') of the file or directory for which to retrieve the status. op is the constant value
  633. // for the operation. tooID is an optional switch to return friendly names in place of owner and group. tooid=false
  634. // returns friendly names instead of the AAD Object ID. Default value is true, returning AAD object IDs.
  635. func (client GroupClient) GetFileStatus(accountName string, pathParameter string, op string, tooID *bool) (result FileStatusResult, err error) {
  636. req, err := client.GetFileStatusPreparer(accountName, pathParameter, op, tooID)
  637. if err != nil {
  638. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "GetFileStatus", nil, "Failure preparing request")
  639. return
  640. }
  641. resp, err := client.GetFileStatusSender(req)
  642. if err != nil {
  643. result.Response = autorest.Response{Response: resp}
  644. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "GetFileStatus", resp, "Failure sending request")
  645. return
  646. }
  647. result, err = client.GetFileStatusResponder(resp)
  648. if err != nil {
  649. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "GetFileStatus", resp, "Failure responding to request")
  650. }
  651. return
  652. }
  653. // GetFileStatusPreparer prepares the GetFileStatus request.
  654. func (client GroupClient) GetFileStatusPreparer(accountName string, pathParameter string, op string, tooID *bool) (*http.Request, error) {
  655. urlParameters := map[string]interface{}{
  656. "accountName": accountName,
  657. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  658. }
  659. pathParameters := map[string]interface{}{
  660. "path": autorest.Encode("path", pathParameter),
  661. }
  662. const APIVersion = "2016-11-01"
  663. queryParameters := map[string]interface{}{
  664. "api-version": APIVersion,
  665. "op": autorest.Encode("query", op),
  666. }
  667. if tooID != nil {
  668. queryParameters["tooId"] = autorest.Encode("query", *tooID)
  669. }
  670. preparer := autorest.CreatePreparer(
  671. autorest.AsGet(),
  672. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  673. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  674. autorest.WithQueryParameters(queryParameters))
  675. return preparer.Prepare(&http.Request{})
  676. }
  677. // GetFileStatusSender sends the GetFileStatus request. The method will close the
  678. // http.Response Body if it receives an error.
  679. func (client GroupClient) GetFileStatusSender(req *http.Request) (*http.Response, error) {
  680. return autorest.SendWithSender(client,
  681. req,
  682. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  683. }
  684. // GetFileStatusResponder handles the response to the GetFileStatus request. The method always
  685. // closes the http.Response Body.
  686. func (client GroupClient) GetFileStatusResponder(resp *http.Response) (result FileStatusResult, err error) {
  687. err = autorest.Respond(
  688. resp,
  689. client.ByInspecting(),
  690. azure.WithErrorUnlessStatusCode(http.StatusOK),
  691. autorest.ByUnmarshallingJSON(&result),
  692. autorest.ByClosing())
  693. result.Response = autorest.Response{Response: resp}
  694. return
  695. }
  696. // ListFileStatus get the list of file status objects specified by the file path, with optional pagination parameters
  697. //
  698. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  699. // Store path (starting with '/') of the directory to list. op is the constant value for the operation. listSize is
  700. // gets or sets the number of items to return. Optional. listAfter is gets or sets the item or lexographical index
  701. // after which to begin returning results. For example, a file list of 'a','b','d' and listAfter='b' will return 'd',
  702. // and a listAfter='c' will also return 'd'. Optional. listBefore is gets or sets the item or lexographical index
  703. // before which to begin returning results. For example, a file list of 'a','b','d' and listBefore='d' will return
  704. // 'a','b', and a listBefore='c' will also return 'a','b'. Optional. tooID is an optional switch to return friendly
  705. // names in place of owner and group. tooid=false returns friendly names instead of the AAD Object ID. Default value is
  706. // true, returning AAD object IDs.
  707. func (client GroupClient) ListFileStatus(accountName string, pathParameter string, op string, listSize *int32, listAfter string, listBefore string, tooID *bool) (result FileStatusesResult, err error) {
  708. req, err := client.ListFileStatusPreparer(accountName, pathParameter, op, listSize, listAfter, listBefore, tooID)
  709. if err != nil {
  710. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "ListFileStatus", nil, "Failure preparing request")
  711. return
  712. }
  713. resp, err := client.ListFileStatusSender(req)
  714. if err != nil {
  715. result.Response = autorest.Response{Response: resp}
  716. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "ListFileStatus", resp, "Failure sending request")
  717. return
  718. }
  719. result, err = client.ListFileStatusResponder(resp)
  720. if err != nil {
  721. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "ListFileStatus", resp, "Failure responding to request")
  722. }
  723. return
  724. }
  725. // ListFileStatusPreparer prepares the ListFileStatus request.
  726. func (client GroupClient) ListFileStatusPreparer(accountName string, pathParameter string, op string, listSize *int32, listAfter string, listBefore string, tooID *bool) (*http.Request, error) {
  727. urlParameters := map[string]interface{}{
  728. "accountName": accountName,
  729. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  730. }
  731. pathParameters := map[string]interface{}{
  732. "path": autorest.Encode("path", pathParameter),
  733. }
  734. const APIVersion = "2016-11-01"
  735. queryParameters := map[string]interface{}{
  736. "api-version": APIVersion,
  737. "op": autorest.Encode("query", op),
  738. }
  739. if listSize != nil {
  740. queryParameters["listSize"] = autorest.Encode("query", *listSize)
  741. }
  742. if len(listAfter) > 0 {
  743. queryParameters["listAfter"] = autorest.Encode("query", listAfter)
  744. }
  745. if len(listBefore) > 0 {
  746. queryParameters["listBefore"] = autorest.Encode("query", listBefore)
  747. }
  748. if tooID != nil {
  749. queryParameters["tooId"] = autorest.Encode("query", *tooID)
  750. }
  751. preparer := autorest.CreatePreparer(
  752. autorest.AsGet(),
  753. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  754. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  755. autorest.WithQueryParameters(queryParameters))
  756. return preparer.Prepare(&http.Request{})
  757. }
  758. // ListFileStatusSender sends the ListFileStatus request. The method will close the
  759. // http.Response Body if it receives an error.
  760. func (client GroupClient) ListFileStatusSender(req *http.Request) (*http.Response, error) {
  761. return autorest.SendWithSender(client,
  762. req,
  763. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  764. }
  765. // ListFileStatusResponder handles the response to the ListFileStatus request. The method always
  766. // closes the http.Response Body.
  767. func (client GroupClient) ListFileStatusResponder(resp *http.Response) (result FileStatusesResult, err error) {
  768. err = autorest.Respond(
  769. resp,
  770. client.ByInspecting(),
  771. azure.WithErrorUnlessStatusCode(http.StatusOK),
  772. autorest.ByUnmarshallingJSON(&result),
  773. autorest.ByClosing())
  774. result.Response = autorest.Response{Response: resp}
  775. return
  776. }
  777. // Mkdirs creates a directory.
  778. //
  779. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  780. // Store path (starting with '/') of the directory to create. op is the constant value for the operation. permission is
  781. // optional octal permission with which the directory should be created.
  782. func (client GroupClient) Mkdirs(accountName string, pathParameter string, op string, permission *int32) (result FileOperationResult, err error) {
  783. req, err := client.MkdirsPreparer(accountName, pathParameter, op, permission)
  784. if err != nil {
  785. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "Mkdirs", nil, "Failure preparing request")
  786. return
  787. }
  788. resp, err := client.MkdirsSender(req)
  789. if err != nil {
  790. result.Response = autorest.Response{Response: resp}
  791. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "Mkdirs", resp, "Failure sending request")
  792. return
  793. }
  794. result, err = client.MkdirsResponder(resp)
  795. if err != nil {
  796. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "Mkdirs", resp, "Failure responding to request")
  797. }
  798. return
  799. }
  800. // MkdirsPreparer prepares the Mkdirs request.
  801. func (client GroupClient) MkdirsPreparer(accountName string, pathParameter string, op string, permission *int32) (*http.Request, error) {
  802. urlParameters := map[string]interface{}{
  803. "accountName": accountName,
  804. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  805. }
  806. pathParameters := map[string]interface{}{
  807. "path": autorest.Encode("path", pathParameter),
  808. }
  809. const APIVersion = "2016-11-01"
  810. queryParameters := map[string]interface{}{
  811. "api-version": APIVersion,
  812. "op": autorest.Encode("query", op),
  813. }
  814. if permission != nil {
  815. queryParameters["permission"] = autorest.Encode("query", *permission)
  816. }
  817. preparer := autorest.CreatePreparer(
  818. autorest.AsPut(),
  819. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  820. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  821. autorest.WithQueryParameters(queryParameters))
  822. return preparer.Prepare(&http.Request{})
  823. }
  824. // MkdirsSender sends the Mkdirs request. The method will close the
  825. // http.Response Body if it receives an error.
  826. func (client GroupClient) MkdirsSender(req *http.Request) (*http.Response, error) {
  827. return autorest.SendWithSender(client,
  828. req,
  829. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  830. }
  831. // MkdirsResponder handles the response to the Mkdirs request. The method always
  832. // closes the http.Response Body.
  833. func (client GroupClient) MkdirsResponder(resp *http.Response) (result FileOperationResult, err error) {
  834. err = autorest.Respond(
  835. resp,
  836. client.ByInspecting(),
  837. azure.WithErrorUnlessStatusCode(http.StatusOK),
  838. autorest.ByUnmarshallingJSON(&result),
  839. autorest.ByClosing())
  840. result.Response = autorest.Response{Response: resp}
  841. return
  842. }
  843. // ModifyACLEntries modifies existing Access Control List (ACL) entries on a file or folder.
  844. //
  845. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  846. // Store path (starting with '/') of the file or directory with the ACL being modified. aclspec is the ACL
  847. // specification included in ACL modification operations in the format '[default:]user|group|other::r|-w|-x|-' op is
  848. // the constant value for the operation.
  849. func (client GroupClient) ModifyACLEntries(accountName string, pathParameter string, aclspec string, op string) (result autorest.Response, err error) {
  850. req, err := client.ModifyACLEntriesPreparer(accountName, pathParameter, aclspec, op)
  851. if err != nil {
  852. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "ModifyACLEntries", nil, "Failure preparing request")
  853. return
  854. }
  855. resp, err := client.ModifyACLEntriesSender(req)
  856. if err != nil {
  857. result.Response = resp
  858. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "ModifyACLEntries", resp, "Failure sending request")
  859. return
  860. }
  861. result, err = client.ModifyACLEntriesResponder(resp)
  862. if err != nil {
  863. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "ModifyACLEntries", resp, "Failure responding to request")
  864. }
  865. return
  866. }
  867. // ModifyACLEntriesPreparer prepares the ModifyACLEntries request.
  868. func (client GroupClient) ModifyACLEntriesPreparer(accountName string, pathParameter string, aclspec string, op string) (*http.Request, error) {
  869. urlParameters := map[string]interface{}{
  870. "accountName": accountName,
  871. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  872. }
  873. pathParameters := map[string]interface{}{
  874. "path": autorest.Encode("path", pathParameter),
  875. }
  876. const APIVersion = "2016-11-01"
  877. queryParameters := map[string]interface{}{
  878. "aclspec": autorest.Encode("query", aclspec),
  879. "api-version": APIVersion,
  880. "op": autorest.Encode("query", op),
  881. }
  882. preparer := autorest.CreatePreparer(
  883. autorest.AsPut(),
  884. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  885. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  886. autorest.WithQueryParameters(queryParameters))
  887. return preparer.Prepare(&http.Request{})
  888. }
  889. // ModifyACLEntriesSender sends the ModifyACLEntries request. The method will close the
  890. // http.Response Body if it receives an error.
  891. func (client GroupClient) ModifyACLEntriesSender(req *http.Request) (*http.Response, error) {
  892. return autorest.SendWithSender(client,
  893. req,
  894. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  895. }
  896. // ModifyACLEntriesResponder handles the response to the ModifyACLEntries request. The method always
  897. // closes the http.Response Body.
  898. func (client GroupClient) ModifyACLEntriesResponder(resp *http.Response) (result autorest.Response, err error) {
  899. err = autorest.Respond(
  900. resp,
  901. client.ByInspecting(),
  902. azure.WithErrorUnlessStatusCode(http.StatusOK),
  903. autorest.ByClosing())
  904. result.Response = resp
  905. return
  906. }
  907. // MsConcat concatenates the list of source files into the destination file, deleting all source files upon success.
  908. // This method accepts more source file paths than the Concat method. This method and the parameters it accepts are
  909. // subject to change for usability in an upcoming version.
  910. //
  911. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  912. // Store path (starting with '/') of the destination file resulting from the concatenation. streamContents is a list of
  913. // Data Lake Store paths (starting with '/') of the source files. Must be a comma-separated path list in the format:
  914. // sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv streamContents will be closed upon successful
  915. // return. Callers should ensure closure when receiving an error.op is the constant value for the operation.
  916. // deleteSourceDirectory is indicates that as an optimization instead of deleting each individual source stream, delete
  917. // the source stream folder if all streams are in the same folder instead. This results in a substantial performance
  918. // improvement when the only streams in the folder are part of the concatenation operation. WARNING: This includes the
  919. // deletion of any other files that are not source files. Only set this to true when source files are the only files in
  920. // the source directory.
  921. func (client GroupClient) MsConcat(accountName string, pathParameter string, streamContents io.ReadCloser, op string, deleteSourceDirectory *bool) (result autorest.Response, err error) {
  922. req, err := client.MsConcatPreparer(accountName, pathParameter, streamContents, op, deleteSourceDirectory)
  923. if err != nil {
  924. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "MsConcat", nil, "Failure preparing request")
  925. return
  926. }
  927. resp, err := client.MsConcatSender(req)
  928. if err != nil {
  929. result.Response = resp
  930. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "MsConcat", resp, "Failure sending request")
  931. return
  932. }
  933. result, err = client.MsConcatResponder(resp)
  934. if err != nil {
  935. err = autorest.NewErrorWithError(err, "filesystem.GroupClient", "MsConcat", resp, "Failure responding to request")
  936. }
  937. return
  938. }
  939. // MsConcatPreparer prepares the MsConcat request.
  940. func (client GroupClient) MsConcatPreparer(accountName string, pathParameter string, streamContents io.ReadCloser, op string, deleteSourceDirectory *bool) (*http.Request, error) {
  941. urlParameters := map[string]interface{}{
  942. "accountName": accountName,
  943. "adlsFileSystemDnsSuffix": client.AdlsFileSystemDNSSuffix,
  944. }
  945. pathParameters := map[string]interface{}{
  946. "path": autorest.Encode("path", pathParameter),
  947. }
  948. const APIVersion = "2016-11-01"
  949. queryParameters := map[string]interface{}{
  950. "api-version": APIVersion,
  951. "op": autorest.Encode("query", op),
  952. }
  953. if deleteSourceDirectory != nil {
  954. queryParameters["deleteSourceDirectory"] = autorest.Encode("query", *deleteSourceDirectory)
  955. }
  956. preparer := autorest.CreatePreparer(
  957. autorest.AsPost(),
  958. autorest.WithCustomBaseURL("https://{accountName}.{adlsFileSystemDnsSuffix}", urlParameters),
  959. autorest.WithPathParameters("/webhdfs/v1/{path}", pathParameters),
  960. autorest.WithFile(streamContents),
  961. autorest.WithQueryParameters(queryParameters))
  962. return preparer.Prepare(&http.Request{})
  963. }
  964. // MsConcatSender sends the MsConcat request. The method will close the
  965. // http.Response Body if it receives an error.
  966. func (client GroupClient) MsConcatSender(req *http.Request) (*http.Response, error) {
  967. return autorest.SendWithSender(client,
  968. req,
  969. autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  970. }
  971. // MsConcatResponder handles the response to the MsConcat request. The method always
  972. // closes the http.Response Body.
  973. func (client GroupClient) MsConcatResponder(resp *http.Response) (result autorest.Response, err error) {
  974. err = autorest.Respond(
  975. resp,
  976. client.ByInspecting(),
  977. azure.WithErrorUnlessStatusCode(http.StatusOK),
  978. autorest.ByClosing())
  979. result.Response = resp
  980. return
  981. }
  982. // Open opens and reads from the specified file.
  983. //
  984. // accountName is the Azure Data Lake Store account to execute filesystem operations on. pathParameter is the Data Lake
  985. // Store