|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Kubernetes\API; |
| 4 | + |
| 5 | +use \KubernetesRuntime\AbstractAPI; |
| 6 | +use \Kubernetes\Model\Io\K8s\Api\Core\V1\Binding as TheBinding; |
| 7 | + |
| 8 | +class Binding extends AbstractAPI |
| 9 | +{ |
| 10 | + |
| 11 | + /** |
| 12 | + * create a Binding |
| 13 | + * |
| 14 | + * @param string $namespace object name and auth scope, such as for teams and |
| 15 | + * projects |
| 16 | + * @param TheBinding $Model |
| 17 | + * @param array $queries options: |
| 18 | + * 'dryRun' string |
| 19 | + * When present, indicates that modifications should not be persisted. An invalid |
| 20 | + * or unrecognized dryRun directive will result in an error response and no further |
| 21 | + * processing of the request. Valid values are: - All: all dry run stages will be |
| 22 | + * processed |
| 23 | + * 'fieldManager' string |
| 24 | + * fieldManager is a name associated with the actor or entity that is making these |
| 25 | + * changes. The value must be less than or 128 characters long, and only contain |
| 26 | + * printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. |
| 27 | + * 'fieldValidation' string |
| 28 | + * fieldValidation instructs the server on how to handle objects in the request |
| 29 | + * (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the |
| 30 | + * `ServerSideFieldValidation` feature gate is also enabled. Valid values are: - |
| 31 | + * Ignore: This will ignore any unknown fields that are silently dropped from the |
| 32 | + * object, and will ignore all but the last duplicate field that the decoder |
| 33 | + * encounters. This is the default behavior prior to v1.23 and is the default |
| 34 | + * behavior when the `ServerSideFieldValidation` feature gate is disabled. - Warn: |
| 35 | + * This will send a warning via the standard warning response header for each |
| 36 | + * unknown field that is dropped from the object, and for each duplicate field that |
| 37 | + * is encountered. The request will still succeed if there are no other errors, and |
| 38 | + * will only persist the last of any duplicate fields. This is the default when the |
| 39 | + * `ServerSideFieldValidation` feature gate is enabled. - Strict: This will fail |
| 40 | + * the request with a BadRequest error if any unknown fields would be dropped from |
| 41 | + * the object, or if any duplicate fields are present. The error returned from the |
| 42 | + * server will contain all unknown and duplicate fields encountered. |
| 43 | + * 'pretty' string |
| 44 | + * If 'true', then the output is pretty printed. |
| 45 | + * |
| 46 | + * @return TheBinding|mixed |
| 47 | + */ |
| 48 | + public function create(string $namespace, \Kubernetes\Model\Io\K8s\Api\Core\V1\Binding $Model, array $queries = []) |
| 49 | + { |
| 50 | + return $this->parseResponse( |
| 51 | + $this->client->request('post', |
| 52 | + "/api/v1/namespaces/{$namespace}/bindings", |
| 53 | + [ |
| 54 | + 'json' => $Model->getArrayCopy(), |
| 55 | + 'query' => $queries, |
| 56 | + ] |
| 57 | + ), |
| 58 | + 'createCoreV1NamespacedBinding' |
| 59 | + ); |
| 60 | + } |
| 61 | + |
| 62 | + /** |
| 63 | + * create binding of a Pod |
| 64 | + * |
| 65 | + * @param string $namespace object name and auth scope, such as for teams and |
| 66 | + * projects |
| 67 | + * @param string $name name of the Binding |
| 68 | + * @param TheBinding $Model |
| 69 | + * @param array $queries options: |
| 70 | + * 'dryRun' string |
| 71 | + * When present, indicates that modifications should not be persisted. An invalid |
| 72 | + * or unrecognized dryRun directive will result in an error response and no further |
| 73 | + * processing of the request. Valid values are: - All: all dry run stages will be |
| 74 | + * processed |
| 75 | + * 'fieldManager' string |
| 76 | + * fieldManager is a name associated with the actor or entity that is making these |
| 77 | + * changes. The value must be less than or 128 characters long, and only contain |
| 78 | + * printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. |
| 79 | + * 'fieldValidation' string |
| 80 | + * fieldValidation instructs the server on how to handle objects in the request |
| 81 | + * (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the |
| 82 | + * `ServerSideFieldValidation` feature gate is also enabled. Valid values are: - |
| 83 | + * Ignore: This will ignore any unknown fields that are silently dropped from the |
| 84 | + * object, and will ignore all but the last duplicate field that the decoder |
| 85 | + * encounters. This is the default behavior prior to v1.23 and is the default |
| 86 | + * behavior when the `ServerSideFieldValidation` feature gate is disabled. - Warn: |
| 87 | + * This will send a warning via the standard warning response header for each |
| 88 | + * unknown field that is dropped from the object, and for each duplicate field that |
| 89 | + * is encountered. The request will still succeed if there are no other errors, and |
| 90 | + * will only persist the last of any duplicate fields. This is the default when the |
| 91 | + * `ServerSideFieldValidation` feature gate is enabled. - Strict: This will fail |
| 92 | + * the request with a BadRequest error if any unknown fields would be dropped from |
| 93 | + * the object, or if any duplicate fields are present. The error returned from the |
| 94 | + * server will contain all unknown and duplicate fields encountered. |
| 95 | + * 'pretty' string |
| 96 | + * If 'true', then the output is pretty printed. |
| 97 | + * |
| 98 | + * @return TheBinding|mixed |
| 99 | + */ |
| 100 | + public function createPod(string $namespace, string $name, \Kubernetes\Model\Io\K8s\Api\Core\V1\Binding $Model, array $queries = []) |
| 101 | + { |
| 102 | + return $this->parseResponse( |
| 103 | + $this->client->request('post', |
| 104 | + "/api/v1/namespaces/{$namespace}/pods/{$name}/binding", |
| 105 | + [ |
| 106 | + 'json' => $Model->getArrayCopy(), |
| 107 | + 'query' => $queries, |
| 108 | + ] |
| 109 | + ), |
| 110 | + 'createCoreV1NamespacedPodBinding' |
| 111 | + ); |
| 112 | + } |
| 113 | + |
| 114 | + |
| 115 | +} |
| 116 | + |
0 commit comments