22
22
23
23
24
24
def create_from_yaml (
25
- k8s_client ,
26
- yaml_file ,
27
- verbose = False ,
28
- ** kwargs ):
29
- """
30
- Perform an action from a yaml file. Pass True for verbose to
31
- print confirmation information.
32
- Input:
33
- yaml_file: string. Contains the path to yaml file.
34
- k8s_client: an ApiClient object, initialized with the client args.
35
- verbose: If True, print confirmation from the create action.
36
- Default is False.
37
-
38
- Returns:
39
- An k8s api object or list of apis objects created from YAML.
40
- When a single object is generated, return type is dependent
41
- on output_list.
42
-
43
- Throws a FailToCreateError exception if creation of any object
44
- fails with helpful messages from the server.
45
-
46
- Available parameters for creating <kind>:
47
- :param async_req bool
48
- :param bool include_uninitialized: If true, partially initialized
49
- resources are included in the response.
50
- :param str pretty: If 'true', then the output is pretty printed.
51
- :param str dry_run: When present, indicates that modifications
52
- should not be persisted. An invalid or unrecognized dryRun
53
- directive will result in an error response and no further
54
- processing of the request.
55
- Valid values are: - All: all dry run stages will be processed
56
- """
57
-
58
- create_namespaced_from_yaml (
59
- k8s_client ,
60
- yaml_file ,
61
- verbose ,
62
- namespace = "default" ,
63
- ** kwargs
64
- )
65
-
66
-
67
- def create_namespaced_from_yaml (
68
25
k8s_client ,
69
26
yaml_file ,
70
27
verbose = False ,
@@ -118,14 +75,14 @@ def create_namespaced_from_yaml(
118
75
yml_object ["apiVersion" ] = yml_document ["apiVersion" ]
119
76
yml_object ["kind" ] = kind
120
77
try :
121
- create_namespaced_from_yaml_single_item (
78
+ create_from_yaml_single_item (
122
79
k8s_client , yml_object , verbose , namespace , ** kwargs )
123
80
except client .rest .ApiException as api_exception :
124
81
api_exceptions .append (api_exception )
125
82
else :
126
83
# This is a single object. Call the single item method
127
84
try :
128
- create_namespaced_from_yaml_single_item (
85
+ create_from_yaml_single_item (
129
86
k8s_client , yml_document , verbose , namespace , ** kwargs )
130
87
except client .rest .ApiException as api_exception :
131
88
api_exceptions .append (api_exception )
@@ -135,19 +92,6 @@ def create_namespaced_from_yaml(
135
92
136
93
137
94
def create_from_yaml_single_item (
138
- k8s_client ,
139
- yml_object ,
140
- verbose = False ,
141
- ** kwargs ):
142
- create_namespaced_from_yaml_single_item (
143
- k8s_client ,
144
- yml_object ,
145
- verbose ,
146
- namespace = "default" ,
147
- ** kwargs )
148
-
149
-
150
- def create_namespaced_from_yaml_single_item (
151
95
k8s_client ,
152
96
yml_object ,
153
97
verbose = False ,
0 commit comments