def create_integration( self, name: Optional[str] = None, code: Optional[str] = None, yml: Optional[dict] = None, readme: Optional[str] = None, description: Optional[str] = None, changelog: Optional[str] = None, image: Optional[bytes] = None ) -> Integration: if name is None: name = f'integration_{len(self.integrations)}' if yml is None: yml = {} integration = Integration(self._integrations_path, name, self._repo) integration.build( code, yml, readme, description, changelog, image ) self.integrations.append(integration) return integration
def create_integration(self, name: Optional[str] = None, unified: Optional[bool] = True): if name is None: name = f'integration{len(self.integrations)}' integration = Integration(self._integrations_path, name, self._repo, unified) integration.create_default_integration() self.integrations.append(integration) return integration
def create_integration( self, name: Optional[str] = None, code: Optional[str] = None, yml: Optional[dict] = None, readme: Optional[str] = None, description: Optional[str] = None, changelog: Optional[str] = None, image: Optional[bytes] = None, create_unified=False, ) -> Integration: if name is None: name = f'integration_{len(self.integrations)}' if yml is None: yml = { 'commonfields': { 'id': name, 'version': -1 }, 'name': name, 'display': name, 'description': f'this is an integration {name}', 'script': { 'type': 'python', 'subtype': 'python3', 'script': '', 'commands': [], }, } if image is None: with open( suite_join_path('assets/default_integration', 'sample_image.png'), 'rb') as image_file: image = image_file.read() integration = Integration(self._integrations_path, name, self._repo, create_unified=create_unified) integration.build(code, yml, readme, description, changelog, image) self.integrations.append(integration) return integration