Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

2256 righe
82 KiB

  1. // Package composer provides access to the Cloud Composer API.
  2. //
  3. // See https://cloud.google.com/composer/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/composer/v1beta1"
  8. // ...
  9. // composerService, err := composer.New(oauthHttpClient)
  10. package composer // import "google.golang.org/api/composer/v1beta1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "composer:v1beta1"
  41. const apiName = "composer"
  42. const apiVersion = "v1beta1"
  43. const basePath = "https://composer.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. )
  49. func New(client *http.Client) (*Service, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &Service{client: client, BasePath: basePath}
  54. s.Projects = NewProjectsService(s)
  55. return s, nil
  56. }
  57. type Service struct {
  58. client *http.Client
  59. BasePath string // API endpoint base URL
  60. UserAgent string // optional additional User-Agent fragment
  61. Projects *ProjectsService
  62. }
  63. func (s *Service) userAgent() string {
  64. if s.UserAgent == "" {
  65. return googleapi.UserAgent
  66. }
  67. return googleapi.UserAgent + " " + s.UserAgent
  68. }
  69. func NewProjectsService(s *Service) *ProjectsService {
  70. rs := &ProjectsService{s: s}
  71. rs.Locations = NewProjectsLocationsService(s)
  72. return rs
  73. }
  74. type ProjectsService struct {
  75. s *Service
  76. Locations *ProjectsLocationsService
  77. }
  78. func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
  79. rs := &ProjectsLocationsService{s: s}
  80. rs.Environments = NewProjectsLocationsEnvironmentsService(s)
  81. rs.Operations = NewProjectsLocationsOperationsService(s)
  82. return rs
  83. }
  84. type ProjectsLocationsService struct {
  85. s *Service
  86. Environments *ProjectsLocationsEnvironmentsService
  87. Operations *ProjectsLocationsOperationsService
  88. }
  89. func NewProjectsLocationsEnvironmentsService(s *Service) *ProjectsLocationsEnvironmentsService {
  90. rs := &ProjectsLocationsEnvironmentsService{s: s}
  91. return rs
  92. }
  93. type ProjectsLocationsEnvironmentsService struct {
  94. s *Service
  95. }
  96. func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
  97. rs := &ProjectsLocationsOperationsService{s: s}
  98. return rs
  99. }
  100. type ProjectsLocationsOperationsService struct {
  101. s *Service
  102. }
  103. // Empty: A generic empty message that you can re-use to avoid defining
  104. // duplicated
  105. // empty messages in your APIs. A typical example is to use it as the
  106. // request
  107. // or the response type of an API method. For instance:
  108. //
  109. // service Foo {
  110. // rpc Bar(google.protobuf.Empty) returns
  111. // (google.protobuf.Empty);
  112. // }
  113. //
  114. // The JSON representation for `Empty` is empty JSON object `{}`.
  115. type Empty struct {
  116. // ServerResponse contains the HTTP response code and headers from the
  117. // server.
  118. googleapi.ServerResponse `json:"-"`
  119. }
  120. // Environment: An environment for running orchestration tasks.
  121. type Environment struct {
  122. // Config: Configuration parameters for this environment.
  123. Config *EnvironmentConfig `json:"config,omitempty"`
  124. // CreateTime: Output only.
  125. // The time at which this environment was created.
  126. CreateTime string `json:"createTime,omitempty"`
  127. // Labels: Optional. User-defined labels for this environment.
  128. // The labels map can contain no more than 64 entries. Entries of the
  129. // labels
  130. // map are UTF8 strings that comply with the following restrictions:
  131. //
  132. // * Keys must conform to regexp: \p{Ll}\p{Lo}{0,62}
  133. // * Values must conform to regexp: [\p{Ll}\p{Lo}\p{N}_-]{0,63}
  134. // * Both keys and values are additionally constrained to be <= 128
  135. // bytes in
  136. // size.
  137. Labels map[string]string `json:"labels,omitempty"`
  138. // Name: The resource name of the environment, in the
  139. // form:
  140. // "projects/{projectId}/locations/{locationId}/environments/{envir
  141. // onmentId}"
  142. Name string `json:"name,omitempty"`
  143. // State: The current state of the environment.
  144. //
  145. // Possible values:
  146. // "STATE_UNSPECIFIED" - The state of the environment is unknown.
  147. // "CREATING" - The environment is in the process of being created.
  148. // "RUNNING" - The environment is currently running and healthy. It is
  149. // ready for use.
  150. // "UPDATING" - The environment is being updated. It remains usable
  151. // but cannot receive
  152. // additional update requests or be deleted at this time.
  153. // "DELETING" - The environment is undergoing deletion. It cannot be
  154. // used.
  155. // "ERROR" - The environment has encountered an error and cannot be
  156. // used.
  157. State string `json:"state,omitempty"`
  158. // UpdateTime: Output only.
  159. // The time at which this environment was last modified.
  160. UpdateTime string `json:"updateTime,omitempty"`
  161. // Uuid: Output only.
  162. // The UUID (Universally Unique IDentifier) associated with this
  163. // environment.
  164. // This value is generated when the environment is created.
  165. Uuid string `json:"uuid,omitempty"`
  166. // ServerResponse contains the HTTP response code and headers from the
  167. // server.
  168. googleapi.ServerResponse `json:"-"`
  169. // ForceSendFields is a list of field names (e.g. "Config") to
  170. // unconditionally include in API requests. By default, fields with
  171. // empty values are omitted from API requests. However, any non-pointer,
  172. // non-interface field appearing in ForceSendFields will be sent to the
  173. // server regardless of whether the field is empty or not. This may be
  174. // used to include empty fields in Patch requests.
  175. ForceSendFields []string `json:"-"`
  176. // NullFields is a list of field names (e.g. "Config") to include in API
  177. // requests with the JSON null value. By default, fields with empty
  178. // values are omitted from API requests. However, any field with an
  179. // empty value appearing in NullFields will be sent to the server as
  180. // null. It is an error if a field in this list has a non-empty value.
  181. // This may be used to include null fields in Patch requests.
  182. NullFields []string `json:"-"`
  183. }
  184. func (s *Environment) MarshalJSON() ([]byte, error) {
  185. type NoMethod Environment
  186. raw := NoMethod(*s)
  187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  188. }
  189. // EnvironmentConfig: Configuration information for an environment.
  190. type EnvironmentConfig struct {
  191. // AirflowUri: The URI of the Apache Airflow Web UI hosted within this
  192. // environment (see
  193. // [Airflow web
  194. // interface](/composer/docs/how-to/accessing/airflow-web-interface)).
  195. AirflowUri string `json:"airflowUri,omitempty"`
  196. // DagGcsPrefix: Output only.
  197. // The Cloud Storage prefix of the DAGs for this environment. Although
  198. // Cloud
  199. // Storage objects reside in a flat namespace, a hierarchical file
  200. // tree
  201. // can be simulated using "/"-delimited object name prefixes. DAG
  202. // objects for
  203. // this environment reside in a simulated directory with the given
  204. // prefix.
  205. DagGcsPrefix string `json:"dagGcsPrefix,omitempty"`
  206. // GkeCluster: Output only.
  207. // The Kubernetes Engine cluster used to run this environment.
  208. GkeCluster string `json:"gkeCluster,omitempty"`
  209. // NodeConfig: The configuration used for the Kubernetes Engine cluster.
  210. NodeConfig *NodeConfig `json:"nodeConfig,omitempty"`
  211. // NodeCount: The number of nodes in the Kubernetes Engine cluster that
  212. // will be
  213. // used to run this environment.
  214. NodeCount int64 `json:"nodeCount,omitempty"`
  215. // SoftwareConfig: The configuration settings for software inside the
  216. // environment.
  217. SoftwareConfig *SoftwareConfig `json:"softwareConfig,omitempty"`
  218. // ForceSendFields is a list of field names (e.g. "AirflowUri") to
  219. // unconditionally include in API requests. By default, fields with
  220. // empty values are omitted from API requests. However, any non-pointer,
  221. // non-interface field appearing in ForceSendFields will be sent to the
  222. // server regardless of whether the field is empty or not. This may be
  223. // used to include empty fields in Patch requests.
  224. ForceSendFields []string `json:"-"`
  225. // NullFields is a list of field names (e.g. "AirflowUri") to include in
  226. // API requests with the JSON null value. By default, fields with empty
  227. // values are omitted from API requests. However, any field with an
  228. // empty value appearing in NullFields will be sent to the server as
  229. // null. It is an error if a field in this list has a non-empty value.
  230. // This may be used to include null fields in Patch requests.
  231. NullFields []string `json:"-"`
  232. }
  233. func (s *EnvironmentConfig) MarshalJSON() ([]byte, error) {
  234. type NoMethod EnvironmentConfig
  235. raw := NoMethod(*s)
  236. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  237. }
  238. // ListEnvironmentsResponse: The environments in a project and location.
  239. type ListEnvironmentsResponse struct {
  240. // Environments: The list of environments returned by a
  241. // ListEnvironmentsRequest.
  242. Environments []*Environment `json:"environments,omitempty"`
  243. // NextPageToken: The page token used to query for the next page if one
  244. // exists
  245. NextPageToken string `json:"nextPageToken,omitempty"`
  246. // ServerResponse contains the HTTP response code and headers from the
  247. // server.
  248. googleapi.ServerResponse `json:"-"`
  249. // ForceSendFields is a list of field names (e.g. "Environments") to
  250. // unconditionally include in API requests. By default, fields with
  251. // empty values are omitted from API requests. However, any non-pointer,
  252. // non-interface field appearing in ForceSendFields will be sent to the
  253. // server regardless of whether the field is empty or not. This may be
  254. // used to include empty fields in Patch requests.
  255. ForceSendFields []string `json:"-"`
  256. // NullFields is a list of field names (e.g. "Environments") to include
  257. // in API requests with the JSON null value. By default, fields with
  258. // empty values are omitted from API requests. However, any field with
  259. // an empty value appearing in NullFields will be sent to the server as
  260. // null. It is an error if a field in this list has a non-empty value.
  261. // This may be used to include null fields in Patch requests.
  262. NullFields []string `json:"-"`
  263. }
  264. func (s *ListEnvironmentsResponse) MarshalJSON() ([]byte, error) {
  265. type NoMethod ListEnvironmentsResponse
  266. raw := NoMethod(*s)
  267. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  268. }
  269. // ListOperationsResponse: The response message for
  270. // Operations.ListOperations.
  271. type ListOperationsResponse struct {
  272. // NextPageToken: The standard List next-page token.
  273. NextPageToken string `json:"nextPageToken,omitempty"`
  274. // Operations: A list of operations that matches the specified filter in
  275. // the request.
  276. Operations []*Operation `json:"operations,omitempty"`
  277. // ServerResponse contains the HTTP response code and headers from the
  278. // server.
  279. googleapi.ServerResponse `json:"-"`
  280. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  281. // unconditionally include in API requests. By default, fields with
  282. // empty values are omitted from API requests. However, any non-pointer,
  283. // non-interface field appearing in ForceSendFields will be sent to the
  284. // server regardless of whether the field is empty or not. This may be
  285. // used to include empty fields in Patch requests.
  286. ForceSendFields []string `json:"-"`
  287. // NullFields is a list of field names (e.g. "NextPageToken") to include
  288. // in API requests with the JSON null value. By default, fields with
  289. // empty values are omitted from API requests. However, any field with
  290. // an empty value appearing in NullFields will be sent to the server as
  291. // null. It is an error if a field in this list has a non-empty value.
  292. // This may be used to include null fields in Patch requests.
  293. NullFields []string `json:"-"`
  294. }
  295. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  296. type NoMethod ListOperationsResponse
  297. raw := NoMethod(*s)
  298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  299. }
  300. // NodeConfig: The configuration information for the Kubernetes Engine
  301. // nodes running
  302. // the Apache Airflow software.
  303. type NodeConfig struct {
  304. // DiskSizeGb: Optional. The disk size in GB used for node VMs. Minimum
  305. // size is 10GB.
  306. // If unspecified, defaults to 100GB. Cannot be updated.
  307. DiskSizeGb int64 `json:"diskSizeGb,omitempty"`
  308. // Location: Optional. The Compute Engine
  309. // [zone](/compute/docs/regions-zones) in which
  310. // to deploy the VMs used to run the Apache Airflow software, specified
  311. // as a
  312. // [relative resource
  313. // name](/apis/design/resource_names#relative_resource_name).
  314. // For example: "projects/{projectId}/zones/{zoneId}".
  315. //
  316. // This `location` must belong to the enclosing environment's project
  317. // and
  318. // location. If both this field and `nodeConfig.machineType` are
  319. // specified,
  320. // `nodeConfig.machineType` must belong to this `location`; if both
  321. // are
  322. // unspecified, the service will pick a zone in the Compute Engine
  323. // region
  324. // corresponding to the Cloud Composer location, and propagate that
  325. // choice to
  326. // both fields. If only one field (`location` or
  327. // `nodeConfig.machineType`) is
  328. // specified, the location information from the specified field will
  329. // be
  330. // propagated to the unspecified field.
  331. Location string `json:"location,omitempty"`
  332. // MachineType: Optional. The Compute Engine
  333. // [machine type](/compute/docs/machine-types) used for cluster
  334. // instances,
  335. // specified as a
  336. // [relative resource
  337. // name](/apis/design/resource_names#relative_resource_name).
  338. // For
  339. // example:
  340. // "projects/{projectId}/zones/{zoneId}/machineTypes/{machineTyp
  341. // eId}".
  342. //
  343. // The `machineType` must belong to the enclosing environment's project
  344. // and
  345. // location. If both this field and `nodeConfig.location` are
  346. // specified,
  347. // this `machineType` must belong to the `nodeConfig.location`; if both
  348. // are
  349. // unspecified, the service will pick a zone in the Compute Engine
  350. // region
  351. // corresponding to the Cloud Composer location, and propagate that
  352. // choice to
  353. // both fields. If exactly one of this field and `nodeConfig.location`
  354. // is
  355. // specified, the location information from the specified field will
  356. // be
  357. // propagated to the unspecified field.
  358. //
  359. // If this field is unspecified, the `machineTypeId` defaults
  360. // to "n1-standard-1".
  361. MachineType string `json:"machineType,omitempty"`
  362. // Network: Optional. The Compute Engine network to be used for
  363. // machine
  364. // communications, specified as a
  365. // [relative resource
  366. // name](/apis/design/resource_names#relative_resource_name).
  367. // For example:
  368. // "projects/{projectId}/global/networks/{networkId}".
  369. //
  370. // [Shared VPC](/vpc/docs/shared-vpc) is not currently supported.
  371. // The
  372. // network must belong to the environment's project. If unspecified,
  373. // the
  374. // "default" network ID in the environment's project is used. If
  375. // a
  376. // [Custom Subnet Network]((/vpc/docs/vpc#vpc_networks_and_subnets)
  377. // is provided, `nodeConfig.subnetwork` must also be provided.
  378. Network string `json:"network,omitempty"`
  379. // OauthScopes: Optional. The set of Google API scopes to be made
  380. // available on all
  381. // node VMs. If `oauth_scopes` is empty, defaults
  382. // to
  383. // ["https://www.googleapis.com/auth/cloud-platform"]. Cannot be
  384. // updated.
  385. OauthScopes []string `json:"oauthScopes,omitempty"`
  386. // ServiceAccount: Optional. The Google Cloud Platform Service Account
  387. // to be used by the node
  388. // VMs. If a service account is not specified, the "default" Compute
  389. // Engine
  390. // service account is used. Cannot be updated.
  391. ServiceAccount string `json:"serviceAccount,omitempty"`
  392. // Subnetwork: Optional. The Compute Engine subnetwork to be used for
  393. // machine
  394. // communications, specified as a
  395. // [relative resource
  396. // name](/apis/design/resource_names#relative_resource_name).
  397. // For
  398. // example:
  399. // "projects/{projectId}/regions/{regionId}/subnetworks/{subnetw
  400. // orkId}"
  401. //
  402. // If a subnetwork is provided, `nodeConfig.network` must also be
  403. // provided,
  404. // and the subnetwork must belong to the enclosing environment's project
  405. // and
  406. // location.
  407. Subnetwork string `json:"subnetwork,omitempty"`
  408. // Tags: Optional. The list of instance tags applied to all node VMs.
  409. // Tags are used
  410. // to identify valid sources or targets for network firewalls. Each tag
  411. // within
  412. // the list must comply with
  413. // [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
  414. // Cannot be updated.
  415. Tags []string `json:"tags,omitempty"`
  416. // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to
  417. // unconditionally include in API requests. By default, fields with
  418. // empty values are omitted from API requests. However, any non-pointer,
  419. // non-interface field appearing in ForceSendFields will be sent to the
  420. // server regardless of whether the field is empty or not. This may be
  421. // used to include empty fields in Patch requests.
  422. ForceSendFields []string `json:"-"`
  423. // NullFields is a list of field names (e.g. "DiskSizeGb") to include in
  424. // API requests with the JSON null value. By default, fields with empty
  425. // values are omitted from API requests. However, any field with an
  426. // empty value appearing in NullFields will be sent to the server as
  427. // null. It is an error if a field in this list has a non-empty value.
  428. // This may be used to include null fields in Patch requests.
  429. NullFields []string `json:"-"`
  430. }
  431. func (s *NodeConfig) MarshalJSON() ([]byte, error) {
  432. type NoMethod NodeConfig
  433. raw := NoMethod(*s)
  434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  435. }
  436. // Operation: This resource represents a long-running operation that is
  437. // the result of a
  438. // network API call.
  439. type Operation struct {
  440. // Done: If the value is `false`, it means the operation is still in
  441. // progress.
  442. // If `true`, the operation is completed, and either `error` or
  443. // `response` is
  444. // available.
  445. Done bool `json:"done,omitempty"`
  446. // Error: The error result of the operation in case of failure or
  447. // cancellation.
  448. Error *Status `json:"error,omitempty"`
  449. // Metadata: Service-specific metadata associated with the operation.
  450. // It typically
  451. // contains progress information and common metadata such as create
  452. // time.
  453. // Some services might not provide such metadata. Any method that
  454. // returns a
  455. // long-running operation should document the metadata type, if any.
  456. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  457. // Name: The server-assigned name, which is only unique within the same
  458. // service that
  459. // originally returns it. If you use the default HTTP mapping,
  460. // the
  461. // `name` should have the format of `operations/some/unique/name`.
  462. Name string `json:"name,omitempty"`
  463. // Response: The normal response of the operation in case of success.
  464. // If the original
  465. // method returns no data on success, such as `Delete`, the response
  466. // is
  467. // `google.protobuf.Empty`. If the original method is
  468. // standard
  469. // `Get`/`Create`/`Update`, the response should be the resource. For
  470. // other
  471. // methods, the response should have the type `XxxResponse`, where
  472. // `Xxx`
  473. // is the original method name. For example, if the original method
  474. // name
  475. // is `TakeSnapshot()`, the inferred response type
  476. // is
  477. // `TakeSnapshotResponse`.
  478. Response googleapi.RawMessage `json:"response,omitempty"`
  479. // ServerResponse contains the HTTP response code and headers from the
  480. // server.
  481. googleapi.ServerResponse `json:"-"`
  482. // ForceSendFields is a list of field names (e.g. "Done") to
  483. // unconditionally include in API requests. By default, fields with
  484. // empty values are omitted from API requests. However, any non-pointer,
  485. // non-interface field appearing in ForceSendFields will be sent to the
  486. // server regardless of whether the field is empty or not. This may be
  487. // used to include empty fields in Patch requests.
  488. ForceSendFields []string `json:"-"`
  489. // NullFields is a list of field names (e.g. "Done") to include in API
  490. // requests with the JSON null value. By default, fields with empty
  491. // values are omitted from API requests. However, any field with an
  492. // empty value appearing in NullFields will be sent to the server as
  493. // null. It is an error if a field in this list has a non-empty value.
  494. // This may be used to include null fields in Patch requests.
  495. NullFields []string `json:"-"`
  496. }
  497. func (s *Operation) MarshalJSON() ([]byte, error) {
  498. type NoMethod Operation
  499. raw := NoMethod(*s)
  500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  501. }
  502. // OperationMetadata: Metadata describing an operation.
  503. type OperationMetadata struct {
  504. // CreateTime: Output only.
  505. // The time the operation was submitted to the server.
  506. CreateTime string `json:"createTime,omitempty"`
  507. // EndTime: Output only.
  508. // The time when the operation terminated, regardless of its
  509. // success.
  510. // This field is unset if the operation is still ongoing.
  511. EndTime string `json:"endTime,omitempty"`
  512. // OperationType: Output only.
  513. // The type of operation being performed.
  514. //
  515. // Possible values:
  516. // "TYPE_UNSPECIFIED" - Unused.
  517. // "CREATE" - A resource creation operation.
  518. // "DELETE" - A resource deletion operation.
  519. // "UPDATE" - A resource update operation.
  520. OperationType string `json:"operationType,omitempty"`
  521. // Resource: Output only.
  522. // The resource being operated on, as a [relative resource
  523. // name](
  524. // /apis/design/resource_names#relative_resource_name).
  525. Resource string `json:"resource,omitempty"`
  526. // ResourceUuid: Output only.
  527. // The UUID of the resource being operated on.
  528. ResourceUuid string `json:"resourceUuid,omitempty"`
  529. // State: Output only.
  530. // The current operation state.
  531. //
  532. // Possible values:
  533. // "STATE_UNSPECIFIED" - Unused.
  534. // "PENDING" - The operation has been created but is not yet started.
  535. // "RUNNING" - The operation is underway.
  536. // "SUCCESSFUL" - The operation completed successfully.
  537. // "FAILED" - The operation is no longer running but did not succeed.
  538. State string `json:"state,omitempty"`
  539. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  540. // unconditionally include in API requests. By default, fields with
  541. // empty values are omitted from API requests. However, any non-pointer,
  542. // non-interface field appearing in ForceSendFields will be sent to the
  543. // server regardless of whether the field is empty or not. This may be
  544. // used to include empty fields in Patch requests.
  545. ForceSendFields []string `json:"-"`
  546. // NullFields is a list of field names (e.g. "CreateTime") to include in
  547. // API requests with the JSON null value. By default, fields with empty
  548. // values are omitted from API requests. However, any field with an
  549. // empty value appearing in NullFields will be sent to the server as
  550. // null. It is an error if a field in this list has a non-empty value.
  551. // This may be used to include null fields in Patch requests.
  552. NullFields []string `json:"-"`
  553. }
  554. func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
  555. type NoMethod OperationMetadata
  556. raw := NoMethod(*s)
  557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  558. }
  559. // SoftwareConfig: Specifies the selection and configuration of software
  560. // inside the environment.
  561. type SoftwareConfig struct {
  562. // AirflowConfigOverrides: Optional. Apache Airflow configuration
  563. // properties to override.
  564. //
  565. // Property keys contain the section and property names, separated by a
  566. // hyphen,
  567. // for example "core-dags_are_paused_at_creation". Section names must
  568. // not
  569. // contain hyphens ("-"), opening square brackets ("["), or closing
  570. // square
  571. // brackets ("]"). The property name must not be empty and must not
  572. // contain
  573. // an equals sign ("=") or semicolon (";"). Section and property names
  574. // must
  575. // not contain a period ("."). Apache Airflow configuration property
  576. // names
  577. // must be written in
  578. // [snake_case](https://en.wikipedia.org/wiki/Snake_case).
  579. // Property values can contain any character, and can be written in
  580. // any
  581. // lower/upper case format.
  582. //
  583. // Certain Apache Airflow configuration property values
  584. // are
  585. // [blacklisted](/composer/docs/how-to/managing/setting-airflow-confi
  586. // gurations#airflow_configuration_blacklists),
  587. // and cannot be overridden.
  588. AirflowConfigOverrides map[string]string `json:"airflowConfigOverrides,omitempty"`
  589. // EnvVariables: Optional. Additional environment variables to provide
  590. // to the Apache Airflow
  591. // scheduler, worker, and webserver processes.
  592. //
  593. // Environment variable names must match the regular
  594. // expression
  595. // `a-zA-Z_*`. They cannot specify Apache Airflow
  596. // software configuration overrides (they cannot match the regular
  597. // expression
  598. // `AIRFLOW__[A-Z0-9_]+__[A-Z0-9_]+`), and they cannot match any of
  599. // the
  600. // following reserved names:
  601. //
  602. // * `AIRFLOW_HOME`
  603. // * `C_FORCE_ROOT`
  604. // * `CONTAINER_NAME`
  605. // * `DAGS_FOLDER`
  606. // * `GCP_PROJECT`
  607. // * `GCS_BUCKET`
  608. // * `GKE_CLUSTER_NAME`
  609. // * `SQL_DATABASE`
  610. // * `SQL_INSTANCE`
  611. // * `SQL_PASSWORD`
  612. // * `SQL_PROJECT`
  613. // * `SQL_REGION`
  614. // * `SQL_USER`
  615. EnvVariables map[string]string `json:"envVariables,omitempty"`
  616. // ImageVersion: Output only.
  617. // The version of the software running in the environment.
  618. // This encapsulates both the version of Cloud Composer functionality
  619. // and the
  620. // version of Apache Airflow. It must match the regular
  621. // expression
  622. // `composer-[0-9]+\.[0-9]+(\.[0-9]+)?-airflow-[0-9]+\.[0-9]+(
  623. // \.[0-9]+.*)?`.
  624. //
  625. // The Cloud Composer portion of the version is a
  626. // [semantic version](https://semver.org). The portion of the image
  627. // version
  628. // following <em>airflow-</em> is an official Apache Airflow
  629. // repository
  630. // [release
  631. // name](https://github.com/apache/incubator-airflow/releases).
  632. //
  633. // See also [Release Notes](/composer/docs/release-notes).
  634. ImageVersion string `json:"imageVersion,omitempty"`
  635. // PypiPackages: Optional. Custom Python Package Index (PyPI) packages
  636. // to be installed in
  637. // the environment.
  638. //
  639. // Keys refer to the lowercase package name such as "numpy"
  640. // and values are the lowercase extras and version specifier such
  641. // as
  642. // "==1.12.0", "[devel,gcp_api]", or "[devel]>=1.8.2, <1.9.2". To
  643. // specify a
  644. // package without pinning it to a version specifier, use the empty
  645. // string as
  646. // the value.
  647. PypiPackages map[string]string `json:"pypiPackages,omitempty"`
  648. // ForceSendFields is a list of field names (e.g.
  649. // "AirflowConfigOverrides") to unconditionally include in API requests.
  650. // By default, fields with empty values are omitted from API requests.
  651. // However, any non-pointer, non-interface field appearing in
  652. // ForceSendFields will be sent to the server regardless of whether the
  653. // field is empty or not. This may be used to include empty fields in
  654. // Patch requests.
  655. ForceSendFields []string `json:"-"`
  656. // NullFields is a list of field names (e.g. "AirflowConfigOverrides")
  657. // to include in API requests with the JSON null value. By default,
  658. // fields with empty values are omitted from API requests. However, any
  659. // field with an empty value appearing in NullFields will be sent to the
  660. // server as null. It is an error if a field in this list has a
  661. // non-empty value. This may be used to include null fields in Patch
  662. // requests.
  663. NullFields []string `json:"-"`
  664. }
  665. func (s *SoftwareConfig) MarshalJSON() ([]byte, error) {
  666. type NoMethod SoftwareConfig
  667. raw := NoMethod(*s)
  668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  669. }
  670. // Status: The `Status` type defines a logical error model that is
  671. // suitable for different
  672. // programming environments, including REST APIs and RPC APIs. It is
  673. // used by
  674. // [gRPC](https://github.com/grpc). The error model is designed to
  675. // be:
  676. //
  677. // - Simple to use and understand for most users
  678. // - Flexible enough to meet unexpected needs
  679. //
  680. // # Overview
  681. //
  682. // The `Status` message contains three pieces of data: error code, error
  683. // message,
  684. // and error details. The error code should be an enum value
  685. // of
  686. // google.rpc.Code, but it may accept additional error codes if needed.
  687. // The
  688. // error message should be a developer-facing English message that
  689. // helps
  690. // developers *understand* and *resolve* the error. If a localized
  691. // user-facing
  692. // error message is needed, put the localized message in the error
  693. // details or
  694. // localize it in the client. The optional error details may contain
  695. // arbitrary
  696. // information about the error. There is a predefined set of error
  697. // detail types
  698. // in the package `google.rpc` that can be used for common error
  699. // conditions.
  700. //
  701. // # Language mapping
  702. //
  703. // The `Status` message is the logical representation of the error
  704. // model, but it
  705. // is not necessarily the actual wire format. When the `Status` message
  706. // is
  707. // exposed in different client libraries and different wire protocols,
  708. // it can be
  709. // mapped differently. For example, it will likely be mapped to some
  710. // exceptions
  711. // in Java, but more likely mapped to some error codes in C.
  712. //
  713. // # Other uses
  714. //
  715. // The error model and the `Status` message can be used in a variety
  716. // of
  717. // environments, either with or without APIs, to provide a
  718. // consistent developer experience across different
  719. // environments.
  720. //
  721. // Example uses of this error model include:
  722. //
  723. // - Partial errors. If a service needs to return partial errors to the
  724. // client,
  725. // it may embed the `Status` in the normal response to indicate the
  726. // partial
  727. // errors.
  728. //
  729. // - Workflow errors. A typical workflow has multiple steps. Each step
  730. // may
  731. // have a `Status` message for error reporting.
  732. //
  733. // - Batch operations. If a client uses batch request and batch
  734. // response, the
  735. // `Status` message should be used directly inside batch response,
  736. // one for
  737. // each error sub-response.
  738. //
  739. // - Asynchronous operations. If an API call embeds asynchronous
  740. // operation
  741. // results in its response, the status of those operations should
  742. // be
  743. // represented directly using the `Status` message.
  744. //
  745. // - Logging. If some API errors are stored in logs, the message
  746. // `Status` could
  747. // be used directly after any stripping needed for security/privacy
  748. // reasons.
  749. type Status struct {
  750. // Code: The status code, which should be an enum value of
  751. // google.rpc.Code.
  752. Code int64 `json:"code,omitempty"`
  753. // Details: A list of messages that carry the error details. There is a
  754. // common set of
  755. // message types for APIs to use.
  756. Details []googleapi.RawMessage `json:"details,omitempty"`
  757. // Message: A developer-facing error message, which should be in
  758. // English. Any
  759. // user-facing error message should be localized and sent in
  760. // the
  761. // google.rpc.Status.details field, or localized by the client.
  762. Message string `json:"message,omitempty"`
  763. // ForceSendFields is a list of field names (e.g. "Code") to
  764. // unconditionally include in API requests. By default, fields with
  765. // empty values are omitted from API requests. However, any non-pointer,
  766. // non-interface field appearing in ForceSendFields will be sent to the
  767. // server regardless of whether the field is empty or not. This may be
  768. // used to include empty fields in Patch requests.
  769. ForceSendFields []string `json:"-"`
  770. // NullFields is a list of field names (e.g. "Code") to include in API
  771. // requests with the JSON null value. By default, fields with empty
  772. // values are omitted from API requests. However, any field with an
  773. // empty value appearing in NullFields will be sent to the server as
  774. // null. It is an error if a field in this list has a non-empty value.
  775. // This may be used to include null fields in Patch requests.
  776. NullFields []string `json:"-"`
  777. }
  778. func (s *Status) MarshalJSON() ([]byte, error) {
  779. type NoMethod Status
  780. raw := NoMethod(*s)
  781. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  782. }
  783. // method id "composer.projects.locations.environments.create":
  784. type ProjectsLocationsEnvironmentsCreateCall struct {
  785. s *Service
  786. parent string
  787. environment *Environment
  788. urlParams_ gensupport.URLParams
  789. ctx_ context.Context
  790. header_ http.Header
  791. }
  792. // Create: Create a new environment.
  793. func (r *ProjectsLocationsEnvironmentsService) Create(parent string, environment *Environment) *ProjectsLocationsEnvironmentsCreateCall {
  794. c := &ProjectsLocationsEnvironmentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  795. c.parent = parent
  796. c.environment = environment
  797. return c
  798. }
  799. // Fields allows partial responses to be retrieved. See
  800. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  801. // for more information.
  802. func (c *ProjectsLocationsEnvironmentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsCreateCall {
  803. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  804. return c
  805. }
  806. // Context sets the context to be used in this call's Do method. Any
  807. // pending HTTP request will be aborted if the provided context is
  808. // canceled.
  809. func (c *ProjectsLocationsEnvironmentsCreateCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsCreateCall {
  810. c.ctx_ = ctx
  811. return c
  812. }
  813. // Header returns an http.Header that can be modified by the caller to
  814. // add HTTP headers to the request.
  815. func (c *ProjectsLocationsEnvironmentsCreateCall) Header() http.Header {
  816. if c.header_ == nil {
  817. c.header_ = make(http.Header)
  818. }
  819. return c.header_
  820. }
  821. func (c *ProjectsLocationsEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) {
  822. reqHeaders := make(http.Header)
  823. for k, v := range c.header_ {
  824. reqHeaders[k] = v
  825. }
  826. reqHeaders.Set("User-Agent", c.s.userAgent())
  827. var body io.Reader = nil
  828. body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
  829. if err != nil {
  830. return nil, err
  831. }
  832. reqHeaders.Set("Content-Type", "application/json")
  833. c.urlParams_.Set("alt", alt)
  834. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/environments")
  835. urls += "?" + c.urlParams_.Encode()
  836. req, _ := http.NewRequest("POST", urls, body)
  837. req.Header = reqHeaders
  838. googleapi.Expand(req.URL, map[string]string{
  839. "parent": c.parent,
  840. })
  841. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  842. }
  843. // Do executes the "composer.projects.locations.environments.create" call.
  844. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  845. // status code is an error. Response headers are in either
  846. // *Operation.ServerResponse.Header or (if a response was returned at
  847. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  848. // to check whether the returned error was because
  849. // http.StatusNotModified was returned.
  850. func (c *ProjectsLocationsEnvironmentsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  851. gensupport.SetOptions(c.urlParams_, opts...)
  852. res, err := c.doRequest("json")
  853. if res != nil && res.StatusCode == http.StatusNotModified {
  854. if res.Body != nil {
  855. res.Body.Close()
  856. }
  857. return nil, &googleapi.Error{
  858. Code: res.StatusCode,
  859. Header: res.Header,
  860. }
  861. }
  862. if err != nil {
  863. return nil, err
  864. }
  865. defer googleapi.CloseBody(res)
  866. if err := googleapi.CheckResponse(res); err != nil {
  867. return nil, err
  868. }
  869. ret := &Operation{
  870. ServerResponse: googleapi.ServerResponse{
  871. Header: res.Header,
  872. HTTPStatusCode: res.StatusCode,
  873. },
  874. }
  875. target := &ret
  876. if err := gensupport.DecodeResponse(target, res); err != nil {
  877. return nil, err
  878. }
  879. return ret, nil
  880. // {
  881. // "description": "Create a new environment.",
  882. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/environments",
  883. // "httpMethod": "POST",
  884. // "id": "composer.projects.locations.environments.create",
  885. // "parameterOrder": [
  886. // "parent"
  887. // ],
  888. // "parameters": {
  889. // "parent": {
  890. // "description": "The parent must be of the form \"projects/{projectId}/locations/{locationId}\".",
  891. // "location": "path",
  892. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  893. // "required": true,
  894. // "type": "string"
  895. // }
  896. // },
  897. // "path": "v1beta1/{+parent}/environments",
  898. // "request": {
  899. // "$ref": "Environment"
  900. // },
  901. // "response": {
  902. // "$ref": "Operation"
  903. // },
  904. // "scopes": [
  905. // "https://www.googleapis.com/auth/cloud-platform"
  906. // ]
  907. // }
  908. }
  909. // method id "composer.projects.locations.environments.delete":
  910. type ProjectsLocationsEnvironmentsDeleteCall struct {
  911. s *Service
  912. name string
  913. urlParams_ gensupport.URLParams
  914. ctx_ context.Context
  915. header_ http.Header
  916. }
  917. // Delete: Delete an environment.
  918. func (r *ProjectsLocationsEnvironmentsService) Delete(name string) *ProjectsLocationsEnvironmentsDeleteCall {
  919. c := &ProjectsLocationsEnvironmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  920. c.name = name
  921. return c
  922. }
  923. // Fields allows partial responses to be retrieved. See
  924. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  925. // for more information.
  926. func (c *ProjectsLocationsEnvironmentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsDeleteCall {
  927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  928. return c
  929. }
  930. // Context sets the context to be used in this call's Do method. Any
  931. // pending HTTP request will be aborted if the provided context is
  932. // canceled.
  933. func (c *ProjectsLocationsEnvironmentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsDeleteCall {
  934. c.ctx_ = ctx
  935. return c
  936. }
  937. // Header returns an http.Header that can be modified by the caller to
  938. // add HTTP headers to the request.
  939. func (c *ProjectsLocationsEnvironmentsDeleteCall) Header() http.Header {
  940. if c.header_ == nil {
  941. c.header_ = make(http.Header)
  942. }
  943. return c.header_
  944. }
  945. func (c *ProjectsLocationsEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  946. reqHeaders := make(http.Header)
  947. for k, v := range c.header_ {
  948. reqHeaders[k] = v
  949. }
  950. reqHeaders.Set("User-Agent", c.s.userAgent())
  951. var body io.Reader = nil
  952. c.urlParams_.Set("alt", alt)
  953. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  954. urls += "?" + c.urlParams_.Encode()
  955. req, _ := http.NewRequest("DELETE", urls, body)
  956. req.Header = reqHeaders
  957. googleapi.Expand(req.URL, map[string]string{
  958. "name": c.name,
  959. })
  960. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  961. }
  962. // Do executes the "composer.projects.locations.environments.delete" call.
  963. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  964. // status code is an error. Response headers are in either
  965. // *Operation.ServerResponse.Header or (if a response was returned at
  966. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  967. // to check whether the returned error was because
  968. // http.StatusNotModified was returned.
  969. func (c *ProjectsLocationsEnvironmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  970. gensupport.SetOptions(c.urlParams_, opts...)
  971. res, err := c.doRequest("json")
  972. if res != nil && res.StatusCode == http.StatusNotModified {
  973. if res.Body != nil {
  974. res.Body.Close()
  975. }
  976. return nil, &googleapi.Error{
  977. Code: res.StatusCode,
  978. Header: res.Header,
  979. }
  980. }
  981. if err != nil {
  982. return nil, err
  983. }
  984. defer googleapi.CloseBody(res)
  985. if err := googleapi.CheckResponse(res); err != nil {
  986. return nil, err
  987. }
  988. ret := &Operation{
  989. ServerResponse: googleapi.ServerResponse{
  990. Header: res.Header,
  991. HTTPStatusCode: res.StatusCode,
  992. },
  993. }
  994. target := &ret
  995. if err := gensupport.DecodeResponse(target, res); err != nil {
  996. return nil, err
  997. }
  998. return ret, nil
  999. // {
  1000. // "description": "Delete an environment.",
  1001. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}",
  1002. // "httpMethod": "DELETE",
  1003. // "id": "composer.projects.locations.environments.delete",
  1004. // "parameterOrder": [
  1005. // "name"
  1006. // ],
  1007. // "parameters": {
  1008. // "name": {
  1009. // "description": "The environment to delete, in the form:\n\"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"",
  1010. // "location": "path",
  1011. // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$",
  1012. // "required": true,
  1013. // "type": "string"
  1014. // }
  1015. // },
  1016. // "path": "v1beta1/{+name}",
  1017. // "response": {
  1018. // "$ref": "Operation"
  1019. // },
  1020. // "scopes": [
  1021. // "https://www.googleapis.com/auth/cloud-platform"
  1022. // ]
  1023. // }
  1024. }
  1025. // method id "composer.projects.locations.environments.get":
  1026. type ProjectsLocationsEnvironmentsGetCall struct {
  1027. s *Service
  1028. name string
  1029. urlParams_ gensupport.URLParams
  1030. ifNoneMatch_ string
  1031. ctx_ context.Context
  1032. header_ http.Header
  1033. }
  1034. // Get: Get an existing environment.
  1035. func (r *ProjectsLocationsEnvironmentsService) Get(name string) *ProjectsLocationsEnvironmentsGetCall {
  1036. c := &ProjectsLocationsEnvironmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1037. c.name = name
  1038. return c
  1039. }
  1040. // Fields allows partial responses to be retrieved. See
  1041. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1042. // for more information.
  1043. func (c *ProjectsLocationsEnvironmentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsGetCall {
  1044. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1045. return c
  1046. }
  1047. // IfNoneMatch sets the optional parameter which makes the operation
  1048. // fail if the object's ETag matches the given value. This is useful for
  1049. // getting updates only after the object has changed since the last
  1050. // request. Use googleapi.IsNotModified to check whether the response
  1051. // error from Do is the result of In-None-Match.
  1052. func (c *ProjectsLocationsEnvironmentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsEnvironmentsGetCall {
  1053. c.ifNoneMatch_ = entityTag
  1054. return c
  1055. }
  1056. // Context sets the context to be used in this call's Do method. Any
  1057. // pending HTTP request will be aborted if the provided context is
  1058. // canceled.
  1059. func (c *ProjectsLocationsEnvironmentsGetCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsGetCall {
  1060. c.ctx_ = ctx
  1061. return c
  1062. }
  1063. // Header returns an http.Header that can be modified by the caller to
  1064. // add HTTP headers to the request.
  1065. func (c *ProjectsLocationsEnvironmentsGetCall) Header() http.Header {
  1066. if c.header_ == nil {
  1067. c.header_ = make(http.Header)
  1068. }
  1069. return c.header_
  1070. }
  1071. func (c *ProjectsLocationsEnvironmentsGetCall) doRequest(alt string) (*http.Response, error) {
  1072. reqHeaders := make(http.Header)
  1073. for k, v := range c.header_ {
  1074. reqHeaders[k] = v
  1075. }
  1076. reqHeaders.Set("User-Agent", c.s.userAgent())
  1077. if c.ifNoneMatch_ != "" {
  1078. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1079. }
  1080. var body io.Reader = nil
  1081. c.urlParams_.Set("alt", alt)
  1082. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1083. urls += "?" + c.urlParams_.Encode()
  1084. req, _ := http.NewRequest("GET", urls, body)
  1085. req.Header = reqHeaders
  1086. googleapi.Expand(req.URL, map[string]string{
  1087. "name": c.name,
  1088. })
  1089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1090. }
  1091. // Do executes the "composer.projects.locations.environments.get" call.
  1092. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  1093. // status code is an error. Response headers are in either
  1094. // *Environment.ServerResponse.Header or (if a response was returned at
  1095. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1096. // to check whether the returned error was because
  1097. // http.StatusNotModified was returned.
  1098. func (c *ProjectsLocationsEnvironmentsGetCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  1099. gensupport.SetOptions(c.urlParams_, opts...)
  1100. res, err := c.doRequest("json")
  1101. if res != nil && res.StatusCode == http.StatusNotModified {
  1102. if res.Body != nil {
  1103. res.Body.Close()
  1104. }
  1105. return nil, &googleapi.Error{
  1106. Code: res.StatusCode,
  1107. Header: res.Header,
  1108. }
  1109. }
  1110. if err != nil {
  1111. return nil, err
  1112. }
  1113. defer googleapi.CloseBody(res)
  1114. if err := googleapi.CheckResponse(res); err != nil {
  1115. return nil, err
  1116. }
  1117. ret := &Environment{
  1118. ServerResponse: googleapi.ServerResponse{
  1119. Header: res.Header,
  1120. HTTPStatusCode: res.StatusCode,
  1121. },
  1122. }
  1123. target := &ret
  1124. if err := gensupport.DecodeResponse(target, res); err != nil {
  1125. return nil, err
  1126. }
  1127. return ret, nil
  1128. // {
  1129. // "description": "Get an existing environment.",
  1130. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}",
  1131. // "httpMethod": "GET",
  1132. // "id": "composer.projects.locations.environments.get",
  1133. // "parameterOrder": [
  1134. // "name"
  1135. // ],
  1136. // "parameters": {
  1137. // "name": {
  1138. // "description": "The resource name of the environment to get, in the form:\n\"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"",
  1139. // "location": "path",
  1140. // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$",
  1141. // "required": true,
  1142. // "type": "string"
  1143. // }
  1144. // },
  1145. // "path": "v1beta1/{+name}",
  1146. // "response": {
  1147. // "$ref": "Environment"
  1148. // },
  1149. // "scopes": [
  1150. // "https://www.googleapis.com/auth/cloud-platform"
  1151. // ]
  1152. // }
  1153. }
  1154. // method id "composer.projects.locations.environments.list":
  1155. type ProjectsLocationsEnvironmentsListCall struct {
  1156. s *Service
  1157. parent string
  1158. urlParams_ gensupport.URLParams
  1159. ifNoneMatch_ string
  1160. ctx_ context.Context
  1161. header_ http.Header
  1162. }
  1163. // List: List environments.
  1164. func (r *ProjectsLocationsEnvironmentsService) List(parent string) *ProjectsLocationsEnvironmentsListCall {
  1165. c := &ProjectsLocationsEnvironmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1166. c.parent = parent
  1167. return c
  1168. }
  1169. // PageSize sets the optional parameter "pageSize": The maximum number
  1170. // of environments to return.
  1171. func (c *ProjectsLocationsEnvironmentsListCall) PageSize(pageSize int64) *ProjectsLocationsEnvironmentsListCall {
  1172. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1173. return c
  1174. }
  1175. // PageToken sets the optional parameter "pageToken": The
  1176. // next_page_token value returned from a previous List request, if any.
  1177. func (c *ProjectsLocationsEnvironmentsListCall) PageToken(pageToken string) *ProjectsLocationsEnvironmentsListCall {
  1178. c.urlParams_.Set("pageToken", pageToken)
  1179. return c
  1180. }
  1181. // Fields allows partial responses to be retrieved. See
  1182. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1183. // for more information.
  1184. func (c *ProjectsLocationsEnvironmentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsListCall {
  1185. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1186. return c
  1187. }
  1188. // IfNoneMatch sets the optional parameter which makes the operation
  1189. // fail if the object's ETag matches the given value. This is useful for
  1190. // getting updates only after the object has changed since the last
  1191. // request. Use googleapi.IsNotModified to check whether the response
  1192. // error from Do is the result of In-None-Match.
  1193. func (c *ProjectsLocationsEnvironmentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsEnvironmentsListCall {
  1194. c.ifNoneMatch_ = entityTag
  1195. return c
  1196. }
  1197. // Context sets the context to be used in this call's Do method. Any
  1198. // pending HTTP request will be aborted if the provided context is
  1199. // canceled.
  1200. func (c *ProjectsLocationsEnvironmentsListCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsListCall {
  1201. c.ctx_ = ctx
  1202. return c
  1203. }
  1204. // Header returns an http.Header that can be modified by the caller to
  1205. // add HTTP headers to the request.
  1206. func (c *ProjectsLocationsEnvironmentsListCall) Header() http.Header {
  1207. if c.header_ == nil {
  1208. c.header_ = make(http.Header)
  1209. }
  1210. return c.header_
  1211. }
  1212. func (c *ProjectsLocationsEnvironmentsListCall) doRequest(alt string) (*http.Response, error) {
  1213. reqHeaders := make(http.Header)
  1214. for k, v := range c.header_ {
  1215. reqHeaders[k] = v
  1216. }
  1217. reqHeaders.Set("User-Agent", c.s.userAgent())
  1218. if c.ifNoneMatch_ != "" {
  1219. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1220. }
  1221. var body io.Reader = nil
  1222. c.urlParams_.Set("alt", alt)
  1223. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/environments")
  1224. urls += "?" + c.urlParams_.Encode()
  1225. req, _ := http.NewRequest("GET", urls, body)
  1226. req.Header = reqHeaders
  1227. googleapi.Expand(req.URL, map[string]string{
  1228. "parent": c.parent,
  1229. })
  1230. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1231. }
  1232. // Do executes the "composer.projects.locations.environments.list" call.
  1233. // Exactly one of *ListEnvironmentsResponse or error will be non-nil.
  1234. // Any non-2xx status code is an error. Response headers are in either
  1235. // *ListEnvironmentsResponse.ServerResponse.Header or (if a response was
  1236. // returned at all) in error.(*googleapi.Error).Header. Use
  1237. // googleapi.IsNotModified to check whether the returned error was
  1238. // because http.StatusNotModified was returned.
  1239. func (c *ProjectsLocationsEnvironmentsListCall) Do(opts ...googleapi.CallOption) (*ListEnvironmentsResponse, error) {
  1240. gensupport.SetOptions(c.urlParams_, opts...)
  1241. res, err := c.doRequest("json")
  1242. if res != nil && res.StatusCode == http.StatusNotModified {
  1243. if res.Body != nil {
  1244. res.Body.Close()
  1245. }
  1246. return nil, &googleapi.Error{
  1247. Code: res.StatusCode,
  1248. Header: res.Header,
  1249. }
  1250. }
  1251. if err != nil {
  1252. return nil, err
  1253. }
  1254. defer googleapi.CloseBody(res)
  1255. if err := googleapi.CheckResponse(res); err != nil {
  1256. return nil, err
  1257. }
  1258. ret := &ListEnvironmentsResponse{
  1259. ServerResponse: googleapi.ServerResponse{
  1260. Header: res.Header,
  1261. HTTPStatusCode: res.StatusCode,
  1262. },
  1263. }
  1264. target := &ret
  1265. if err := gensupport.DecodeResponse(target, res); err != nil {
  1266. return nil, err
  1267. }
  1268. return ret, nil
  1269. // {
  1270. // "description": "List environments.",
  1271. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/environments",
  1272. // "httpMethod": "GET",
  1273. // "id": "composer.projects.locations.environments.list",
  1274. // "parameterOrder": [
  1275. // "parent"
  1276. // ],
  1277. // "parameters": {
  1278. // "pageSize": {
  1279. // "description": "The maximum number of environments to return.",
  1280. // "format": "int32",
  1281. // "location": "query",
  1282. // "type": "integer"
  1283. // },
  1284. // "pageToken": {
  1285. // "description": "The next_page_token value returned from a previous List request, if any.",
  1286. // "location": "query",
  1287. // "type": "string"
  1288. // },
  1289. // "parent": {
  1290. // "description": "List environments in the given project and location, in the form:\n\"projects/{projectId}/locations/{locationId}\"",
  1291. // "location": "path",
  1292. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  1293. // "required": true,
  1294. // "type": "string"
  1295. // }
  1296. // },
  1297. // "path": "v1beta1/{+parent}/environments",
  1298. // "response": {
  1299. // "$ref": "ListEnvironmentsResponse"
  1300. // },
  1301. // "scopes": [
  1302. // "https://www.googleapis.com/auth/cloud-platform"
  1303. // ]
  1304. // }
  1305. }
  1306. // Pages invokes f for each page of results.
  1307. // A non-nil error returned from f will halt the iteration.
  1308. // The provided context supersedes any context provided to the Context method.
  1309. func (c *ProjectsLocationsEnvironmentsListCall) Pages(ctx context.Context, f func(*ListEnvironmentsResponse) error) error {
  1310. c.ctx_ = ctx
  1311. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1312. for {
  1313. x, err := c.Do()
  1314. if err != nil {
  1315. return err
  1316. }
  1317. if err := f(x); err != nil {
  1318. return err
  1319. }
  1320. if x.NextPageToken == "" {
  1321. return nil
  1322. }
  1323. c.PageToken(x.NextPageToken)
  1324. }
  1325. }
  1326. // method id "composer.projects.locations.environments.patch":
  1327. type ProjectsLocationsEnvironmentsPatchCall struct {
  1328. s *Service
  1329. name string
  1330. environment *Environment
  1331. urlParams_ gensupport.URLParams
  1332. ctx_ context.Context
  1333. header_ http.Header
  1334. }
  1335. // Patch: Update an environment.
  1336. func (r *ProjectsLocationsEnvironmentsService) Patch(name string, environment *Environment) *ProjectsLocationsEnvironmentsPatchCall {
  1337. c := &ProjectsLocationsEnvironmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1338. c.name = name
  1339. c.environment = environment
  1340. return c
  1341. }
  1342. // UpdateMask sets the optional parameter "updateMask": Required. A
  1343. // comma-separated list of paths, relative to `Environment`, of
  1344. // fields to update.
  1345. // For example, to set the version of scikit-learn to install in
  1346. // the
  1347. // environment to 0.19.0 and to remove an existing installation
  1348. // of
  1349. // argparse, the `updateMask` parameter would include the following
  1350. // two
  1351. // `paths` values: "config.softwareConfig.pypiPackages.scikit-learn"
  1352. // and
  1353. // "config.softwareConfig.pypiPackages.argparse". The included
  1354. // patch
  1355. // environment would specify the scikit-learn version as follows:
  1356. //
  1357. // {
  1358. // "config":{
  1359. // "softwareConfig":{
  1360. // "pypiPackages":{
  1361. // "scikit-learn":"==0.19.0"
  1362. // }
  1363. // }
  1364. // }
  1365. // }
  1366. //
  1367. // Note that in the above example, any existing PyPI packages
  1368. // other than scikit-learn and argparse will be unaffected.
  1369. //
  1370. // Only one update type may be included in a single request's
  1371. // `updateMask`.
  1372. // For example, one cannot update both the PyPI packages and
  1373. // labels in the same request. However, it is possible to update
  1374. // multiple
  1375. // members of a map field simultaneously in the same request. For
  1376. // example,
  1377. // to set the labels "label1" and "label2" while clearing "label3"
  1378. // (assuming
  1379. // it already exists), one can
  1380. // provide the paths "labels.label1", "labels.label2", and
  1381. // "labels.label3"
  1382. // and populate the patch environment as follows:
  1383. //
  1384. // {
  1385. // "labels":{
  1386. // "label1":"new-label1-value"
  1387. // "label2":"new-label2-value"
  1388. // }
  1389. // }
  1390. //
  1391. // Note that in the above example, any existing labels that are
  1392. // not
  1393. // included in the `updateMask` will be unaffected.
  1394. //
  1395. // It is also possible to replace an entire map field by providing
  1396. // the
  1397. // map field's path in the `updateMask`. The new value of the field
  1398. // will
  1399. // be that which is provided in the patch environment. For example,
  1400. // to
  1401. // delete all pre-existing user-specified PyPI packages and
  1402. // install botocore at version 1.7.14, the `updateMask` would
  1403. // contain
  1404. // the path "config.softwareConfig.pypiPackages", and
  1405. // the patch environment would be the following:
  1406. //
  1407. // {
  1408. // "config":{
  1409. // "softwareConfig":{
  1410. // "pypiPackages":{
  1411. // "botocore":"==1.7.14"
  1412. // }
  1413. // }
  1414. // }
  1415. // }
  1416. //
  1417. // <strong>Note:</strong> Only the following fields can be updated:
  1418. //
  1419. // <table>
  1420. // <tbody>
  1421. // <tr>
  1422. // <td><strong>Mask</strong></td>
  1423. // <td><strong>Purpose</strong></td>
  1424. // </tr>
  1425. // <tr>
  1426. // <td>config.softwareConfig.pypiPackages
  1427. // </td>
  1428. // <td>Replace all custom custom PyPI packages. If a replacement
  1429. // package map is not included in `environment`, all custom
  1430. // PyPI packages are cleared. It is an error to provide both this mask
  1431. // and a
  1432. // mask specifying an individual package.</td>
  1433. // </tr>
  1434. // <tr>
  1435. // <td>config.softwareConfig.pypiPackages.<var>packagename</var></td>
  1436. // <td>Update the custom PyPI package <var>packagename</var>,
  1437. // preserving other packages. To delete the package, include it in
  1438. // `updateMask`, and omit the mapping for it in
  1439. // `environment.config.softwareConfig.pypiPackages`. It is an error
  1440. // to provide both a mask of this form and the
  1441. // "config.softwareConfig.pypiPackages" mask.</td>
  1442. // </tr>
  1443. // <tr>
  1444. // <td>labels</td>
  1445. // <td>Replace all environment labels. If a replacement labels map is
  1446. // not
  1447. // included in `environment`, all labels are cleared. It is an error
  1448. // to
  1449. // provide both this mask and a mask specifying one or more individual
  1450. // labels.</td>
  1451. // </tr>
  1452. // <tr>
  1453. // <td>labels.<var>labelName</var></td>
  1454. // <td>Set the label named <var>labelName</var>, while preserving
  1455. // other
  1456. // labels. To delete the label, include it in `updateMask` and omit
  1457. // its
  1458. // mapping in `environment.labels`. It is an error to provide both a
  1459. // mask of this form and the "labels" mask.</td>
  1460. // </tr>
  1461. // <tr>
  1462. // <td>config.nodeCount</td>
  1463. // <td>Horizontally scale the number of nodes in the environment. An
  1464. // integer
  1465. // greater than or equal to 3 must be provided in the
  1466. // `config.nodeCount` field.
  1467. // </td>
  1468. // </tr>
  1469. // <tr>
  1470. // <td>config.softwareConfig.airflowConfigOverrides</td>
  1471. // <td>Replace all Apache Airflow config overrides. If a replacement
  1472. // config
  1473. // overrides map is not included in `environment`, all config
  1474. // overrides
  1475. // are cleared.
  1476. // It is an error to provide both this mask and a mask specifying one
  1477. // or
  1478. // more individual config overrides.</td>
  1479. // </tr>
  1480. // <tr>
  1481. // <td>config.softwareConfig.properties.<var>section</var>-<var>name
  1482. // </var></td>
  1483. // <td>Override the Apache Airflow property <var>name</var> in the
  1484. // section
  1485. // named <var>section</var>, preserving other properties. To delete
  1486. // the
  1487. // property override, include it in `updateMask` and omit its mapping
  1488. // in `environment.config.softwareConfig.properties`.
  1489. // It is an error to provide both a mask of this form and the
  1490. // "config.softwareConfig.properties" mask.</td>
  1491. // </tr>
  1492. // <tr>
  1493. // <td>config.softwareConfig.envVariables</td>
  1494. // <td>Replace all environment variables. If a replacement environment
  1495. // variable map is not included in `environment`, all custom
  1496. // environment
  1497. // variables are cleared.
  1498. // It is an error to provide both this mask and a mask specifying one
  1499. // or
  1500. // more individual environment variables.</td>
  1501. // </tr>
  1502. // </tbody>
  1503. // </table>
  1504. func (c *ProjectsLocationsEnvironmentsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsEnvironmentsPatchCall {
  1505. c.urlParams_.Set("updateMask", updateMask)
  1506. return c
  1507. }
  1508. // Fields allows partial responses to be retrieved. See
  1509. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1510. // for more information.
  1511. func (c *ProjectsLocationsEnvironmentsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsPatchCall {
  1512. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1513. return c
  1514. }
  1515. // Context sets the context to be used in this call's Do method. Any
  1516. // pending HTTP request will be aborted if the provided context is
  1517. // canceled.
  1518. func (c *ProjectsLocationsEnvironmentsPatchCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsPatchCall {
  1519. c.ctx_ = ctx
  1520. return c
  1521. }
  1522. // Header returns an http.Header that can be modified by the caller to
  1523. // add HTTP headers to the request.
  1524. func (c *ProjectsLocationsEnvironmentsPatchCall) Header() http.Header {
  1525. if c.header_ == nil {
  1526. c.header_ = make(http.Header)
  1527. }
  1528. return c.header_
  1529. }
  1530. func (c *ProjectsLocationsEnvironmentsPatchCall) doRequest(alt string) (*http.Response, error) {
  1531. reqHeaders := make(http.Header)
  1532. for k, v := range c.header_ {
  1533. reqHeaders[k] = v
  1534. }
  1535. reqHeaders.Set("User-Agent", c.s.userAgent())
  1536. var body io.Reader = nil
  1537. body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
  1538. if err != nil {
  1539. return nil, err
  1540. }
  1541. reqHeaders.Set("Content-Type", "application/json")
  1542. c.urlParams_.Set("alt", alt)
  1543. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1544. urls += "?" + c.urlParams_.Encode()
  1545. req, _ := http.NewRequest("PATCH", urls, body)
  1546. req.Header = reqHeaders
  1547. googleapi.Expand(req.URL, map[string]string{
  1548. "name": c.name,
  1549. })
  1550. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1551. }
  1552. // Do executes the "composer.projects.locations.environments.patch" call.
  1553. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1554. // status code is an error. Response headers are in either
  1555. // *Operation.ServerResponse.Header or (if a response was returned at
  1556. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1557. // to check whether the returned error was because
  1558. // http.StatusNotModified was returned.
  1559. func (c *ProjectsLocationsEnvironmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1560. gensupport.SetOptions(c.urlParams_, opts...)
  1561. res, err := c.doRequest("json")
  1562. if res != nil && res.StatusCode == http.StatusNotModified {
  1563. if res.Body != nil {
  1564. res.Body.Close()
  1565. }
  1566. return nil, &googleapi.Error{
  1567. Code: res.StatusCode,
  1568. Header: res.Header,
  1569. }
  1570. }
  1571. if err != nil {
  1572. return nil, err
  1573. }
  1574. defer googleapi.CloseBody(res)
  1575. if err := googleapi.CheckResponse(res); err != nil {
  1576. return nil, err
  1577. }
  1578. ret := &Operation{
  1579. ServerResponse: googleapi.ServerResponse{
  1580. Header: res.Header,
  1581. HTTPStatusCode: res.StatusCode,
  1582. },
  1583. }
  1584. target := &ret
  1585. if err := gensupport.DecodeResponse(target, res); err != nil {
  1586. return nil, err
  1587. }
  1588. return ret, nil
  1589. // {
  1590. // "description": "Update an environment.",
  1591. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}",
  1592. // "httpMethod": "PATCH",
  1593. // "id": "composer.projects.locations.environments.patch",
  1594. // "parameterOrder": [
  1595. // "name"
  1596. // ],
  1597. // "parameters": {
  1598. // "name": {
  1599. // "description": "The relative resource name of the environment to update, in the form:\n\"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"",
  1600. // "location": "path",
  1601. // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$",
  1602. // "required": true,
  1603. // "type": "string"
  1604. // },
  1605. // "updateMask": {
  1606. // "description": "Required. A comma-separated list of paths, relative to `Environment`, of\nfields to update.\nFor example, to set the version of scikit-learn to install in the\nenvironment to 0.19.0 and to remove an existing installation of\nargparse, the `updateMask` parameter would include the following two\n`paths` values: \"config.softwareConfig.pypiPackages.scikit-learn\" and\n\"config.softwareConfig.pypiPackages.argparse\". The included patch\nenvironment would specify the scikit-learn version as follows:\n\n {\n \"config\":{\n \"softwareConfig\":{\n \"pypiPackages\":{\n \"scikit-learn\":\"==0.19.0\"\n }\n }\n }\n }\n\nNote that in the above example, any existing PyPI packages\nother than scikit-learn and argparse will be unaffected.\n\nOnly one update type may be included in a single request's `updateMask`.\nFor example, one cannot update both the PyPI packages and\nlabels in the same request. However, it is possible to update multiple\nmembers of a map field simultaneously in the same request. For example,\nto set the labels \"label1\" and \"label2\" while clearing \"label3\" (assuming\nit already exists), one can\nprovide the paths \"labels.label1\", \"labels.label2\", and \"labels.label3\"\nand populate the patch environment as follows:\n\n {\n \"labels\":{\n \"label1\":\"new-label1-value\"\n \"label2\":\"new-label2-value\"\n }\n }\n\nNote that in the above example, any existing labels that are not\nincluded in the `updateMask` will be unaffected.\n\nIt is also possible to replace an entire map field by providing the\nmap field's path in the `updateMask`. The new value of the field will\nbe that which is provided in the patch environment. For example, to\ndelete all pre-existing user-specified PyPI packages and\ninstall botocore at version 1.7.14, the `updateMask` would contain\nthe path \"config.softwareConfig.pypiPackages\", and\nthe patch environment would be the following:\n\n {\n \"config\":{\n \"softwareConfig\":{\n \"pypiPackages\":{\n \"botocore\":\"==1.7.14\"\n }\n }\n }\n }\n\n\u003cstrong\u003eNote:\u003c/strong\u003e Only the following fields can be updated:\n\n \u003ctable\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cstrong\u003eMask\u003c/strong\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cstrong\u003ePurpose\u003c/strong\u003e\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003econfig.softwareConfig.pypiPackages\n \u003c/td\u003e\n \u003ctd\u003eReplace all custom custom PyPI packages. If a replacement\n package map is not included in `environment`, all custom\n PyPI packages are cleared. It is an error to provide both this mask and a\n mask specifying an individual package.\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003econfig.softwareConfig.pypiPackages.\u003cvar\u003epackagename\u003c/var\u003e\u003c/td\u003e\n \u003ctd\u003eUpdate the custom PyPI package \u003cvar\u003epackagename\u003c/var\u003e,\n preserving other packages. To delete the package, include it in\n `updateMask`, and omit the mapping for it in\n `environment.config.softwareConfig.pypiPackages`. It is an error\n to provide both a mask of this form and the\n \"config.softwareConfig.pypiPackages\" mask.\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003elabels\u003c/td\u003e\n \u003ctd\u003eReplace all environment labels. If a replacement labels map is not\n included in `environment`, all labels are cleared. It is an error to\n provide both this mask and a mask specifying one or more individual\n labels.\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003elabels.\u003cvar\u003elabelName\u003c/var\u003e\u003c/td\u003e\n \u003ctd\u003eSet the label named \u003cvar\u003elabelName\u003c/var\u003e, while preserving other\n labels. To delete the label, include it in `updateMask` and omit its\n mapping in `environment.labels`. It is an error to provide both a\n mask of this form and the \"labels\" mask.\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003econfig.nodeCount\u003c/td\u003e\n \u003ctd\u003eHorizontally scale the number of nodes in the environment. An integer\n greater than or equal to 3 must be provided in the `config.nodeCount` field.\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003econfig.softwareConfig.airflowConfigOverrides\u003c/td\u003e\n \u003ctd\u003eReplace all Apache Airflow config overrides. If a replacement config\n overrides map is not included in `environment`, all config overrides\n are cleared.\n It is an error to provide both this mask and a mask specifying one or\n more individual config overrides.\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003econfig.softwareConfig.properties.\u003cvar\u003esection\u003c/var\u003e-\u003cvar\u003ename\n \u003c/var\u003e\u003c/td\u003e\n \u003ctd\u003eOverride the Apache Airflow property \u003cvar\u003ename\u003c/var\u003e in the section\n named \u003cvar\u003esection\u003c/var\u003e, preserving other properties. To delete the\n property override, include it in `updateMask` and omit its mapping\n in `environment.config.softwareConfig.properties`.\n It is an error to provide both a mask of this form and the\n \"config.softwareConfig.properties\" mask.\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003econfig.softwareConfig.envVariables\u003c/td\u003e\n \u003ctd\u003eReplace all environment variables. If a replacement environment\n variable map is not included in `environment`, all custom environment\n variables are cleared.\n It is an error to provide both this mask and a mask specifying one or\n more individual environment variables.\u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e",
  1607. // "format": "google-fieldmask",
  1608. // "location": "query",
  1609. // "type": "string"
  1610. // }
  1611. // },
  1612. // "path": "v1beta1/{+name}",
  1613. // "request": {
  1614. // "$ref": "Environment"
  1615. // },
  1616. // "response": {
  1617. // "$ref": "Operation"
  1618. // },
  1619. // "scopes": [
  1620. // "https://www.googleapis.com/auth/cloud-platform"
  1621. // ]
  1622. // }
  1623. }
  1624. // method id "composer.projects.locations.operations.delete":
  1625. type ProjectsLocationsOperationsDeleteCall struct {
  1626. s *Service
  1627. name string
  1628. urlParams_ gensupport.URLParams
  1629. ctx_ context.Context
  1630. header_ http.Header
  1631. }
  1632. // Delete: Deletes a long-running operation. This method indicates that
  1633. // the client is
  1634. // no longer interested in the operation result. It does not cancel
  1635. // the
  1636. // operation. If the server doesn't support this method, it
  1637. // returns
  1638. // `google.rpc.Code.UNIMPLEMENTED`.
  1639. func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
  1640. c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1641. c.name = name
  1642. return c
  1643. }
  1644. // Fields allows partial responses to be retrieved. See
  1645. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1646. // for more information.
  1647. func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
  1648. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1649. return c
  1650. }
  1651. // Context sets the context to be used in this call's Do method. Any
  1652. // pending HTTP request will be aborted if the provided context is
  1653. // canceled.
  1654. func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
  1655. c.ctx_ = ctx
  1656. return c
  1657. }
  1658. // Header returns an http.Header that can be modified by the caller to
  1659. // add HTTP headers to the request.
  1660. func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
  1661. if c.header_ == nil {
  1662. c.header_ = make(http.Header)
  1663. }
  1664. return c.header_
  1665. }
  1666. func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1667. reqHeaders := make(http.Header)
  1668. for k, v := range c.header_ {
  1669. reqHeaders[k] = v
  1670. }
  1671. reqHeaders.Set("User-Agent", c.s.userAgent())
  1672. var body io.Reader = nil
  1673. c.urlParams_.Set("alt", alt)
  1674. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1675. urls += "?" + c.urlParams_.Encode()
  1676. req, _ := http.NewRequest("DELETE", urls, body)
  1677. req.Header = reqHeaders
  1678. googleapi.Expand(req.URL, map[string]string{
  1679. "name": c.name,
  1680. })
  1681. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1682. }
  1683. // Do executes the "composer.projects.locations.operations.delete" call.
  1684. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  1685. // code is an error. Response headers are in either
  1686. // *Empty.ServerResponse.Header or (if a response was returned at all)
  1687. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1688. // check whether the returned error was because http.StatusNotModified
  1689. // was returned.
  1690. func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1691. gensupport.SetOptions(c.urlParams_, opts...)
  1692. res, err := c.doRequest("json")
  1693. if res != nil && res.StatusCode == http.StatusNotModified {
  1694. if res.Body != nil {
  1695. res.Body.Close()
  1696. }
  1697. return nil, &googleapi.Error{
  1698. Code: res.StatusCode,
  1699. Header: res.Header,
  1700. }
  1701. }
  1702. if err != nil {
  1703. return nil, err
  1704. }
  1705. defer googleapi.CloseBody(res)
  1706. if err := googleapi.CheckResponse(res); err != nil {
  1707. return nil, err
  1708. }
  1709. ret := &Empty{
  1710. ServerResponse: googleapi.ServerResponse{
  1711. Header: res.Header,
  1712. HTTPStatusCode: res.StatusCode,
  1713. },
  1714. }
  1715. target := &ret
  1716. if err := gensupport.DecodeResponse(target, res); err != nil {
  1717. return nil, err
  1718. }
  1719. return ret, nil
  1720. // {
  1721. // "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.",
  1722. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
  1723. // "httpMethod": "DELETE",
  1724. // "id": "composer.projects.locations.operations.delete",
  1725. // "parameterOrder": [
  1726. // "name"
  1727. // ],
  1728. // "parameters": {
  1729. // "name": {
  1730. // "description": "The name of the operation resource to be deleted.",
  1731. // "location": "path",
  1732. // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  1733. // "required": true,
  1734. // "type": "string"
  1735. // }
  1736. // },
  1737. // "path": "v1beta1/{+name}",
  1738. // "response": {
  1739. // "$ref": "Empty"
  1740. // },
  1741. // "scopes": [
  1742. // "https://www.googleapis.com/auth/cloud-platform"
  1743. // ]
  1744. // }
  1745. }
  1746. // method id "composer.projects.locations.operations.get":
  1747. type ProjectsLocationsOperationsGetCall struct {
  1748. s *Service
  1749. name string
  1750. urlParams_ gensupport.URLParams
  1751. ifNoneMatch_ string
  1752. ctx_ context.Context
  1753. header_ http.Header
  1754. }
  1755. // Get: Gets the latest state of a long-running operation. Clients can
  1756. // use this
  1757. // method to poll the operation result at intervals as recommended by
  1758. // the API
  1759. // service.
  1760. func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  1761. c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1762. c.name = name
  1763. return c
  1764. }
  1765. // Fields allows partial responses to be retrieved. See
  1766. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1767. // for more information.
  1768. func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  1769. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1770. return c
  1771. }
  1772. // IfNoneMatch sets the optional parameter which makes the operation
  1773. // fail if the object's ETag matches the given value. This is useful for
  1774. // getting updates only after the object has changed since the last
  1775. // request. Use googleapi.IsNotModified to check whether the response
  1776. // error from Do is the result of In-None-Match.
  1777. func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  1778. c.ifNoneMatch_ = entityTag
  1779. return c
  1780. }
  1781. // Context sets the context to be used in this call's Do method. Any
  1782. // pending HTTP request will be aborted if the provided context is
  1783. // canceled.
  1784. func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  1785. c.ctx_ = ctx
  1786. return c
  1787. }
  1788. // Header returns an http.Header that can be modified by the caller to
  1789. // add HTTP headers to the request.
  1790. func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  1791. if c.header_ == nil {
  1792. c.header_ = make(http.Header)
  1793. }
  1794. return c.header_
  1795. }
  1796. func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  1797. reqHeaders := make(http.Header)
  1798. for k, v := range c.header_ {
  1799. reqHeaders[k] = v
  1800. }
  1801. reqHeaders.Set("User-Agent", c.s.userAgent())
  1802. if c.ifNoneMatch_ != "" {
  1803. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1804. }
  1805. var body io.Reader = nil
  1806. c.urlParams_.Set("alt", alt)
  1807. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1808. urls += "?" + c.urlParams_.Encode()
  1809. req, _ := http.NewRequest("GET", urls, body)
  1810. req.Header = reqHeaders
  1811. googleapi.Expand(req.URL, map[string]string{
  1812. "name": c.name,
  1813. })
  1814. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1815. }
  1816. // Do executes the "composer.projects.locations.operations.get" call.
  1817. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1818. // status code is an error. Response headers are in either
  1819. // *Operation.ServerResponse.Header or (if a response was returned at
  1820. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1821. // to check whether the returned error was because
  1822. // http.StatusNotModified was returned.
  1823. func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1824. gensupport.SetOptions(c.urlParams_, opts...)
  1825. res, err := c.doRequest("json")
  1826. if res != nil && res.StatusCode == http.StatusNotModified {
  1827. if res.Body != nil {
  1828. res.Body.Close()
  1829. }
  1830. return nil, &googleapi.Error{
  1831. Code: res.StatusCode,
  1832. Header: res.Header,
  1833. }
  1834. }
  1835. if err != nil {
  1836. return nil, err
  1837. }
  1838. defer googleapi.CloseBody(res)
  1839. if err := googleapi.CheckResponse(res); err != nil {
  1840. return nil, err
  1841. }
  1842. ret := &Operation{
  1843. ServerResponse: googleapi.ServerResponse{
  1844. Header: res.Header,
  1845. HTTPStatusCode: res.StatusCode,
  1846. },
  1847. }
  1848. target := &ret
  1849. if err := gensupport.DecodeResponse(target, res); err != nil {
  1850. return nil, err
  1851. }
  1852. return ret, nil
  1853. // {
  1854. // "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.",
  1855. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
  1856. // "httpMethod": "GET",
  1857. // "id": "composer.projects.locations.operations.get",
  1858. // "parameterOrder": [
  1859. // "name"
  1860. // ],
  1861. // "parameters": {
  1862. // "name": {
  1863. // "description": "The name of the operation resource.",
  1864. // "location": "path",
  1865. // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  1866. // "required": true,
  1867. // "type": "string"
  1868. // }
  1869. // },
  1870. // "path": "v1beta1/{+name}",
  1871. // "response": {
  1872. // "$ref": "Operation"
  1873. // },
  1874. // "scopes": [
  1875. // "https://www.googleapis.com/auth/cloud-platform"
  1876. // ]
  1877. // }
  1878. }
  1879. // method id "composer.projects.locations.operations.list":
  1880. type ProjectsLocationsOperationsListCall struct {
  1881. s *Service
  1882. name string
  1883. urlParams_ gensupport.URLParams
  1884. ifNoneMatch_ string
  1885. ctx_ context.Context
  1886. header_ http.Header
  1887. }
  1888. // List: Lists operations that match the specified filter in the
  1889. // request. If the
  1890. // server doesn't support this method, it returns
  1891. // `UNIMPLEMENTED`.
  1892. //
  1893. // NOTE: the `name` binding allows API services to override the
  1894. // binding
  1895. // to use different resource name schemes, such as `users/*/operations`.
  1896. // To
  1897. // override the binding, API services can add a binding such
  1898. // as
  1899. // "/v1/{name=users/*}/operations" to their service configuration.
  1900. // For backwards compatibility, the default name includes the
  1901. // operations
  1902. // collection id, however overriding users must ensure the name
  1903. // binding
  1904. // is the parent resource, without the operations collection id.
  1905. func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
  1906. c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1907. c.name = name
  1908. return c
  1909. }
  1910. // Filter sets the optional parameter "filter": The standard list
  1911. // filter.
  1912. func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
  1913. c.urlParams_.Set("filter", filter)
  1914. return c
  1915. }
  1916. // PageSize sets the optional parameter "pageSize": The standard list
  1917. // page size.
  1918. func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
  1919. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1920. return c
  1921. }
  1922. // PageToken sets the optional parameter "pageToken": The standard list
  1923. // page token.
  1924. func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
  1925. c.urlParams_.Set("pageToken", pageToken)
  1926. return c
  1927. }
  1928. // Fields allows partial responses to be retrieved. See
  1929. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1930. // for more information.
  1931. func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  1932. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1933. return c
  1934. }
  1935. // IfNoneMatch sets the optional parameter which makes the operation
  1936. // fail if the object's ETag matches the given value. This is useful for
  1937. // getting updates only after the object has changed since the last
  1938. // request. Use googleapi.IsNotModified to check whether the response
  1939. // error from Do is the result of In-None-Match.
  1940. func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  1941. c.ifNoneMatch_ = entityTag
  1942. return c
  1943. }
  1944. // Context sets the context to be used in this call's Do method. Any
  1945. // pending HTTP request will be aborted if the provided context is
  1946. // canceled.
  1947. func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  1948. c.ctx_ = ctx
  1949. return c
  1950. }
  1951. // Header returns an http.Header that can be modified by the caller to
  1952. // add HTTP headers to the request.
  1953. func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  1954. if c.header_ == nil {
  1955. c.header_ = make(http.Header)
  1956. }
  1957. return c.header_
  1958. }
  1959. func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  1960. reqHeaders := make(http.Header)
  1961. for k, v := range c.header_ {
  1962. reqHeaders[k] = v
  1963. }
  1964. reqHeaders.Set("User-Agent", c.s.userAgent())
  1965. if c.ifNoneMatch_ != "" {
  1966. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1967. }
  1968. var body io.Reader = nil
  1969. c.urlParams_.Set("alt", alt)
  1970. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations")
  1971. urls += "?" + c.urlParams_.Encode()
  1972. req, _ := http.NewRequest("GET", urls, body)
  1973. req.Header = reqHeaders
  1974. googleapi.Expand(req.URL, map[string]string{
  1975. "name": c.name,
  1976. })
  1977. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1978. }
  1979. // Do executes the "composer.projects.locations.operations.list" call.
  1980. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  1981. // non-2xx status code is an error. Response headers are in either
  1982. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  1983. // returned at all) in error.(*googleapi.Error).Header. Use
  1984. // googleapi.IsNotModified to check whether the returned error was
  1985. // because http.StatusNotModified was returned.
  1986. func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  1987. gensupport.SetOptions(c.urlParams_, opts...)
  1988. res, err := c.doRequest("json")
  1989. if res != nil && res.StatusCode == http.StatusNotModified {
  1990. if res.Body != nil {
  1991. res.Body.Close()
  1992. }
  1993. return nil, &googleapi.Error{
  1994. Code: res.StatusCode,
  1995. Header: res.Header,
  1996. }
  1997. }
  1998. if err != nil {
  1999. return nil, err
  2000. }
  2001. defer googleapi.CloseBody(res)
  2002. if err := googleapi.CheckResponse(res); err != nil {
  2003. return nil, err
  2004. }
  2005. ret := &ListOperationsResponse{
  2006. ServerResponse: googleapi.ServerResponse{
  2007. Header: res.Header,
  2008. HTTPStatusCode: res.StatusCode,
  2009. },
  2010. }
  2011. target := &ret
  2012. if err := gensupport.DecodeResponse(target, res); err != nil {
  2013. return nil, err
  2014. }
  2015. return ret, nil
  2016. // {
  2017. // "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.",
  2018. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations",
  2019. // "httpMethod": "GET",
  2020. // "id": "composer.projects.locations.operations.list",
  2021. // "parameterOrder": [
  2022. // "name"
  2023. // ],
  2024. // "parameters": {
  2025. // "filter": {
  2026. // "description": "The standard list filter.",
  2027. // "location": "query",
  2028. // "type": "string"
  2029. // },
  2030. // "name": {
  2031. // "description": "The name of the operation's parent resource.",
  2032. // "location": "path",
  2033. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  2034. // "required": true,
  2035. // "type": "string"
  2036. // },
  2037. // "pageSize": {
  2038. // "description": "The standard list page size.",
  2039. // "format": "int32",
  2040. // "location": "query",
  2041. // "type": "integer"
  2042. // },
  2043. // "pageToken": {
  2044. // "description": "The standard list page token.",
  2045. // "location": "query",
  2046. // "type": "string"
  2047. // }
  2048. // },
  2049. // "path": "v1beta1/{+name}/operations",
  2050. // "response": {
  2051. // "$ref": "ListOperationsResponse"
  2052. // },
  2053. // "scopes": [
  2054. // "https://www.googleapis.com/auth/cloud-platform"
  2055. // ]
  2056. // }
  2057. }
  2058. // Pages invokes f for each page of results.
  2059. // A non-nil error returned from f will halt the iteration.
  2060. // The provided context supersedes any context provided to the Context method.
  2061. func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  2062. c.ctx_ = ctx
  2063. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2064. for {
  2065. x, err := c.Do()
  2066. if err != nil {
  2067. return err
  2068. }
  2069. if err := f(x); err != nil {
  2070. return err
  2071. }
  2072. if x.NextPageToken == "" {
  2073. return nil
  2074. }
  2075. c.PageToken(x.NextPageToken)
  2076. }
  2077. }