@@ -255,50 +255,50 @@ def get_indexer_status(self, name, **kwargs):
255
255
return self ._client .indexers .get_status (name , ** kwargs )
256
256
257
257
@distributed_trace
258
- def create_datasource (self , data_source , ** kwargs ):
258
+ def create_data_source_connection (self , data_source_connection , ** kwargs ):
259
259
# type: (SearchIndexerDataSourceConnection, **Any) -> SearchIndexerDataSourceConnection
260
- """Creates a new datasource .
260
+ """Creates a new data source connection .
261
261
262
- :param data_source : The definition of the datasource to create.
263
- :type data_source : ~search.models.SearchIndexerDataSourceConnection
262
+ :param data_source_connection : The definition of the data source connection to create.
263
+ :type data_source_connection : ~search.models.SearchIndexerDataSourceConnection
264
264
:return: The created SearchIndexerDataSourceConnection
265
265
:rtype: ~search.models.SearchIndexerDataSourceConnection
266
266
267
267
.. admonition:: Example:
268
268
269
269
.. literalinclude:: ../samples/sample_data_source_operations.py
270
- :start-after: [START create_data_source ]
271
- :end-before: [END create_data_source ]
270
+ :start-after: [START create_data_source_connection ]
271
+ :end-before: [END create_data_source_connection ]
272
272
:language: python
273
273
:dedent: 4
274
274
:caption: Create a Data Source
275
275
"""
276
276
kwargs ["headers" ] = self ._merge_client_headers (kwargs .get ("headers" ))
277
- packed_data_source = pack_search_indexer_data_source (data_source )
277
+ packed_data_source = pack_search_indexer_data_source (data_source_connection )
278
278
result = self ._client .data_sources .create (packed_data_source , ** kwargs )
279
279
return unpack_search_indexer_data_source (result )
280
280
281
281
@distributed_trace
282
- def create_or_update_datasource (self , data_source , name = None , ** kwargs ):
282
+ def create_or_update_data_source_connection (self , data_source_connection , name = None , ** kwargs ):
283
283
# type: (SearchIndexerDataSourceConnection, Optional[str], **Any) -> SearchIndexerDataSourceConnection
284
- """Creates a new datasource or updates a datasource if it already exists.
285
- :param name: The name of the datasource to create or update.
284
+ """Creates a new data source connection or updates a data source connection if it already exists.
285
+ :param name: The name of the data source connection to create or update.
286
286
:type name: str
287
- :param data_source : The definition of the datasource to create or update.
288
- :type data_source : ~search.models.SearchIndexerDataSourceConnection
287
+ :param data_source_connection : The definition of the data source connection to create or update.
288
+ :type data_source_connection : ~search.models.SearchIndexerDataSourceConnection
289
289
:keyword match_condition: The match condition to use upon the etag
290
290
:type match_condition: ~azure.core.MatchConditions
291
291
:return: The created SearchIndexerDataSourceConnection
292
292
:rtype: ~search.models.SearchIndexerDataSourceConnection
293
293
"""
294
294
kwargs ["headers" ] = self ._merge_client_headers (kwargs .get ("headers" ))
295
295
error_map , access_condition = get_access_conditions (
296
- data_source , kwargs .pop ("match_condition" , MatchConditions .Unconditionally )
296
+ data_source_connection , kwargs .pop ("match_condition" , MatchConditions .Unconditionally )
297
297
)
298
298
kwargs .update (access_condition )
299
299
if not name :
300
- name = data_source .name
301
- packed_data_source = pack_search_indexer_data_source (data_source )
300
+ name = data_source_connection .name
301
+ packed_data_source = pack_search_indexer_data_source (data_source_connection )
302
302
result = self ._client .data_sources .create_or_update (
303
303
data_source_name = name ,
304
304
data_source = packed_data_source ,
@@ -308,20 +308,20 @@ def create_or_update_datasource(self, data_source, name=None, **kwargs):
308
308
return unpack_search_indexer_data_source (result )
309
309
310
310
@distributed_trace
311
- def get_datasource (self , name , ** kwargs ):
311
+ def get_data_source_connection (self , name , ** kwargs ):
312
312
# type: (str, **Any) -> SearchIndexerDataSourceConnection
313
- """Retrieves a datasource definition.
313
+ """Retrieves a data source connection definition.
314
314
315
- :param name: The name of the datasource to retrieve.
315
+ :param name: The name of the data source connection to retrieve.
316
316
:type name: str
317
317
:return: The SearchIndexerDataSourceConnection that is fetched.
318
318
:rtype: ~search.models.SearchIndexerDataSourceConnection
319
319
320
320
.. admonition:: Example:
321
321
322
322
.. literalinclude:: ../samples/sample_data_source_operations.py
323
- :start-after: [START get_data_source ]
324
- :end-before: [END get_data_source ]
323
+ :start-after: [START get_data_source_connection ]
324
+ :end-before: [END get_data_source_connection ]
325
325
:language: python
326
326
:dedent: 4
327
327
:caption: Retrieve a SearchIndexerDataSourceConnection
@@ -331,18 +331,18 @@ def get_datasource(self, name, **kwargs):
331
331
return unpack_search_indexer_data_source (result )
332
332
333
333
@distributed_trace
334
- def get_datasources (self , ** kwargs ):
334
+ def get_data_source_connections (self , ** kwargs ):
335
335
# type: (**Any) -> Sequence[SearchIndexerDataSourceConnection]
336
- """Lists all datasources available for a search service.
336
+ """Lists all data source connections available for a search service.
337
337
338
- :return: List of all the data sources .
338
+ :return: List of all the data source connections .
339
339
:rtype: `list[~search.models.SearchIndexerDataSourceConnection]`
340
340
341
341
.. admonition:: Example:
342
342
343
343
.. literalinclude:: ../samples/sample_data_source_operations.py
344
- :start-after: [START list_data_source ]
345
- :end-before: [END list_data_source ]
344
+ :start-after: [START list_data_source_connection ]
345
+ :end-before: [END list_data_source_connection ]
346
346
:language: python
347
347
:dedent: 4
348
348
:caption: List all the SearchIndexerDataSourceConnections
@@ -352,14 +352,14 @@ def get_datasources(self, **kwargs):
352
352
return [unpack_search_indexer_data_source (x ) for x in result .data_sources ]
353
353
354
354
@distributed_trace
355
- def delete_datasource (self , data_source , ** kwargs ):
355
+ def delete_data_source_connection (self , data_source_connection , ** kwargs ):
356
356
# type: (Union[str, SearchIndexerDataSourceConnection], **Any) -> None
357
- """Deletes a datasource . To use access conditions, the Datasource model must be
358
- provided instead of the name. It is enough to provide the name of the datasource
357
+ """Deletes a data source connection . To use access conditions, the SearchIndexerDataSourceConnection
358
+ model must be provided instead of the name. It is enough to provide the name of the data source connection
359
359
to delete unconditionally
360
360
361
- :param data_source : The datasource to delete.
362
- :type data_source : str or ~search.models.SearchIndexerDataSourceConnection
361
+ :param data_source_connection : The data source connection to delete.
362
+ :type data_source_connection : str or ~search.models.SearchIndexerDataSourceConnection
363
363
:keyword match_condition: The match condition to use upon the etag
364
364
:type match_condition: ~azure.core.MatchConditions
365
365
:return: None
@@ -368,21 +368,21 @@ def delete_datasource(self, data_source, **kwargs):
368
368
.. admonition:: Example:
369
369
370
370
.. literalinclude:: ../samples/sample_data_source_operations.py
371
- :start-after: [START delete_data_source ]
372
- :end-before: [END delete_data_source ]
371
+ :start-after: [START delete_data_source_connection ]
372
+ :end-before: [END delete_data_source_connection ]
373
373
:language: python
374
374
:dedent: 4
375
375
:caption: Delete a SearchIndexerDataSourceConnection
376
376
"""
377
377
kwargs ["headers" ] = self ._merge_client_headers (kwargs .get ("headers" ))
378
378
error_map , access_condition = get_access_conditions (
379
- data_source , kwargs .pop ("match_condition" , MatchConditions .Unconditionally )
379
+ data_source_connection , kwargs .pop ("match_condition" , MatchConditions .Unconditionally )
380
380
)
381
381
kwargs .update (access_condition )
382
382
try :
383
- name = data_source .name
383
+ name = data_source_connection .name
384
384
except AttributeError :
385
- name = data_source
385
+ name = data_source_connection
386
386
self ._client .data_sources .delete (
387
387
data_source_name = name , error_map = error_map , ** kwargs
388
388
)
0 commit comments